From 3360d8db47a69d94c3f6b3fdabb108d1cd1a883e Mon Sep 17 00:00:00 2001
From: Georgii Novoselov <22564079+farost@users.noreply.github.com>
Date: Tue, 27 Feb 2024 13:04:23 +0000
Subject: [PATCH] Cleaning and rework for fixing Referencing, Declarations &
Usages Search, Renaming, and Syntax Highlighting. (#16)
* Change grammar file to the official typeql dependency. Initial refactoring
* Comment out everything overcomplicated and non-working. Finish a simple version of the parser. Add simple tests for the parser
* Add and fix highlight + colouring
* Finish highlighting, adding icls files and fixing original coloring
* Refactor to make better referencing
* Add distinguished 'as' classes for 'relates', 'owns' and 'plays'. Fix crashes + referencing
* Fix crashes while referencing
* Add an overkill declaration-usages search version. Finish referencing architecture. Refactoring WIP
* Fix elements' names getter's hell
* Refactor old code with small changes, no real logic changes
* Refactor text ranges. Return commenter. Start renaming's fix
* Return completion in some way. Finish renamings (have bugs, presumably because of the referencing bug)
* Add caching to fix some of the bugs
* Fix referencing bugs for types and 'as' overrides
* Fix parsing tests. Fix code style. Fix invalid renaming error
* Rename color schemes. Add highlighting readme
* Comment out NamesValidator
* Add Apache license and some comments
* Fix changelog
* Fix changelog for a tiny bit
* Add [Unreleased] to the changelog
---
CHANGELOG.md | 17 +-
README.md | 139 +-
build.gradle.kts | 11 +-
gradle.properties | 2 +-
src/main/antlr/TypeQL.g4 | 366 -
.../typeql/plugin/jetbrains/TypeQLFileType.kt | 40 +-
.../typeql/plugin/jetbrains/TypeQLIcons.kt | 30 +
.../typeql/plugin/jetbrains/TypeQLLanguage.kt | 36 +-
.../jetbrains/TypeQLParserDefinition.kt | 264 +-
.../plugin/jetbrains/TypeQLTokenSets.kt | 34 +
.../completion/TypeQLCompletionContributor.kt | 117 +-
.../TypeQLCompletionErrorListener.kt | 23 +-
.../highlighter/TypeQLColorSettingsPage.kt | 116 +-
.../highlighter/TypeQLSyntaxHighlighter.kt | 267 +-
.../TypeQLSyntaxHighlighterFactory.kt | 23 +-
.../TypeQLDuplicateDeclarationInspection.kt | 135 +-
.../TypeQLDuplicateDeclarationProvider.kt | 26 +-
.../TypeQLInvalidTypeUsageInspection.kt | 170 +-
.../TypeQLInvalidTypeUsageProvider.kt | 26 +-
.../TypeQLUndefinedDeclarationInspection.kt | 150 +-
.../TypeQLUndefinedDeclarationProvider.kt | 26 +-
.../TypeQLUnplayedRoleInspection.kt | 169 +-
.../TypeQLUnplayedRoleProvider.kt | 26 +-
...eQLUnusedAttributeDeclarationInspection.kt | 95 +-
.../TypeQLUnusedDeclarationProvider.kt | 32 +-
.../TypeQLUnusedRoleDeclarationInspection.kt | 110 +-
.../plugin/jetbrains/psi/PsiTypeQLElement.kt | 55 +-
.../jetbrains/psi/PsiTypeQLElementFactory.kt | 109 +
.../plugin/jetbrains/psi/PsiTypeQLFile.kt | 62 +
.../plugin/jetbrains/psi/PsiTypeQLFileBase.kt | 45 -
.../jetbrains/psi/PsiTypeQLNamedElement.kt | 65 +-
.../psi/PsiTypeQLReferencingElement.kt | 42 +
.../jetbrains/psi/PsiTypeQLStatementType.kt | 91 +
.../plugin/jetbrains/psi/PsiTypeQLUtils.kt | 126 +
.../jetbrains/psi/TypeQLPsiElementFactory.kt | 43 -
.../plugin/jetbrains/psi/TypeQLPsiUtils.kt | 289 -
.../psi/constraint/PsiOwnsTypeConstraint.kt | 29 -
.../psi/constraint/PsiPlaysTypeConstraint.kt | 30 -
.../PsiRelatesSuperRoleTypeConstraint.kt | 15 -
.../constraint/PsiRelatesTypeConstraint.kt | 34 -
.../psi/constraint/PsiSubTypeConstraint.kt | 27 -
.../psi/constraint/PsiTypeConstraint.kt | 22 -
.../constraint/PsiTypeQLAsOverrideTypeBase.kt | 34 +
.../constraint/PsiTypeQLOwnsAsOverrideType.kt | 27 +
.../psi/constraint/PsiTypeQLOwnsType.kt | 49 +
.../PsiTypeQLPlaysAsOverrideType.kt | 27 +
.../psi/constraint/PsiTypeQLPlaysType.kt | 71 +
.../PsiTypeQLRelatesAsOverrideType.kt | 30 +
.../psi/constraint/PsiTypeQLRelatesType.kt | 69 +
.../psi/constraint/PsiTypeQLSubType.kt | 49 +
.../jetbrains/psi/constraint/PsiTypeQLType.kt | 52 +
.../psi/statement/PsiStatementType.kt | 79 -
.../jetbrains/refactor/TypeQLCommenter.kt | 23 +-
.../refactor/TypeQLNamesValidator.kt | 51 +-
.../TypeQLRefactoringSupportProvider.kt | 23 +-
.../jetbrains/reference/TypeQLReference.kt | 89 +-
.../reference/TypeQLReferenceContributor.kt | 102 +-
.../usage/TypeQLDeclarationFinder.kt | 98 +
.../usage/TypeQLFindUsagesProvider.kt | 66 +-
src/main/resources/META-INF/plugin.xml | 102 +-
.../colorSchemes/ClassicLightTypeQL.icls | 87 +
.../resources/colorSchemes/DarculaTypeQL.icls | 87 +
.../resources/colorSchemes/DarkTypeQL.icls | 87 +
.../resources/colorSchemes/LightTypeQL.icls | 87 +
.../plugin/jetbrains/TypeQLParsingTest.kt | 14 -
.../test/parsing/CorrectDefinesTest.kt | 26 +
.../test/parsing/CorrectInsertsTest.kt | 26 +
.../test/parsing/CorrectMatchTest.kt | 26 +
.../test/parsing/IncorrectMatchTest.kt | 26 +
.../test/parsing/IncorrectNoDefineTest.kt | 26 +
.../test/parsing/IncorrectWithDefineTest.kt | 26 +
.../test/parsing/TypeQLParsingTestBase.kt | 38 +
src/test/resources/ParsingTestData.tql | 39 -
src/test/resources/ParsingTestData.txt | 322 -
.../correct_defines/ParsingTestData.tql | 1562 ++
.../correct_defines/ParsingTestData.txt | 14789 ++++++++++++++++
.../correct_inserts/ParsingTestData.tql | 506 +
.../correct_inserts/ParsingTestData.txt | 5866 ++++++
.../parsing/correct_match/ParsingTestData.tql | 29 +
.../parsing/correct_match/ParsingTestData.txt | 356 +
.../incorrect_match/ParsingTestData.tql | 3 +
.../incorrect_match/ParsingTestData.txt | 28 +
.../incorrect_no_define/ParsingTestData.tql | 20 +
.../incorrect_no_define/ParsingTestData.txt | 90 +
.../incorrect_with_define/ParsingTestData.tql | 20 +
.../incorrect_with_define/ParsingTestData.txt | 139 +
86 files changed, 26529 insertions(+), 2371 deletions(-)
delete mode 100644 src/main/antlr/TypeQL.g4
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLIcons.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLTokenSets.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLElementFactory.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLFile.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLFileBase.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLReferencingElement.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLStatementType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLUtils.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/TypeQLPsiElementFactory.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/TypeQLPsiUtils.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiOwnsTypeConstraint.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiPlaysTypeConstraint.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiRelatesSuperRoleTypeConstraint.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiRelatesTypeConstraint.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiSubTypeConstraint.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeConstraint.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLAsOverrideTypeBase.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLOwnsAsOverrideType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLOwnsType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLPlaysAsOverrideType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLPlaysType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLRelatesAsOverrideType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLRelatesType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLSubType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLType.kt
delete mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/statement/PsiStatementType.kt
create mode 100644 src/main/kotlin/org/typedb/typeql/plugin/jetbrains/usage/TypeQLDeclarationFinder.kt
create mode 100644 src/main/resources/colorSchemes/ClassicLightTypeQL.icls
create mode 100644 src/main/resources/colorSchemes/DarculaTypeQL.icls
create mode 100644 src/main/resources/colorSchemes/DarkTypeQL.icls
create mode 100644 src/main/resources/colorSchemes/LightTypeQL.icls
delete mode 100644 src/test/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLParsingTest.kt
create mode 100644 src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectDefinesTest.kt
create mode 100644 src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectInsertsTest.kt
create mode 100644 src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectMatchTest.kt
create mode 100644 src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectMatchTest.kt
create mode 100644 src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectNoDefineTest.kt
create mode 100644 src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectWithDefineTest.kt
create mode 100644 src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/TypeQLParsingTestBase.kt
delete mode 100644 src/test/resources/ParsingTestData.tql
delete mode 100644 src/test/resources/ParsingTestData.txt
create mode 100644 src/test/resources/parsing/correct_defines/ParsingTestData.tql
create mode 100644 src/test/resources/parsing/correct_defines/ParsingTestData.txt
create mode 100644 src/test/resources/parsing/correct_inserts/ParsingTestData.tql
create mode 100644 src/test/resources/parsing/correct_inserts/ParsingTestData.txt
create mode 100644 src/test/resources/parsing/correct_match/ParsingTestData.tql
create mode 100644 src/test/resources/parsing/correct_match/ParsingTestData.txt
create mode 100644 src/test/resources/parsing/incorrect_match/ParsingTestData.tql
create mode 100644 src/test/resources/parsing/incorrect_match/ParsingTestData.txt
create mode 100644 src/test/resources/parsing/incorrect_no_define/ParsingTestData.tql
create mode 100644 src/test/resources/parsing/incorrect_no_define/ParsingTestData.txt
create mode 100644 src/test/resources/parsing/incorrect_with_define/ParsingTestData.tql
create mode 100644 src/test/resources/parsing/incorrect_with_define/ParsingTestData.txt
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 11006f7..d7582bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,11 +3,16 @@
# typeql-plugin-jetbrains Changelog
## [Unreleased]
-### Fixed
-- Added `.typeql` extension to supported file types
-- [Usage highlighting off](https://github.com/typedb-osi/typeql-plugin-jetbrains/issues/8)
-## [0.1.1]
-### Added
-- Basic TypeQL support
+## [0.2.0]
+ - Add `.typeql` to supported extensions.
+ - Update TypeQL grammar based on the recent official releases.
+ - Improve syntax highlighting, coloring, and referencing.
+ - Add TypeDB Studio's color schemes available for import (check out the [official GitHub repo](https://github.com/typedb-osi/typeql-plugin-jetbrains)).
+ - Fix incorrect syntax error highlighting.
+ - Enhance referencing, including override constraints like `owns as`, `plays as`, `relates as`.
+ - Improve `Go To Declaration` and `Find Usages` features work.
+ - Fix `Rename` feature and a set of errors connected to it.
+## [0.1.1]
+ - Add basic TypeQL support for `.tql` files.
diff --git a/README.md b/README.md
index b6fd3b4..037b718 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-Basic support for the [TypeQL language](https://github.com/vaticle/typeql) on JetBrains-based IDEs
+Basic support for the [TypeQL language](https://github.com/vaticle/typeql) on JetBrains-based IDEs.
@@ -44,139 +44,20 @@ Run the tests:
$ ./gradlew test
```
-## Suggested Colouring
+## Supported features
-The following colours are suggested for the best experience, but are not required.
+ - Syntax highlighting and colouring (JetBrains and TypeDB color schemes) based on the official TypeQL grammar.
+ - Find Usages, Go To Declaration.
+ - Rename (currently excluding [references to relations in "plays" constraints](https://github.com/typedb-osi/typeql-plugin-jetbrains/issues/15)).
+ - Code completion.
-You can add these colours to your IDE colour scheme by going to `Preferences → Editor → Color Scheme`, downloading your current scheme. Then, add the following to the `attributes` section of the downloaded scheme:
+### Temporarily disabled features
-- Dark Theme
+ - Unused, Invalid and Duplicated items inspections.
-```
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-- Light Theme
+## Syntax highlighting and colouring
-```
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
+JetBrains Color Scheme-based syntax highlighting automatically works out of the box. However, it is possible to import TypeDB-specific color schemes used in [TypeDB Studio](https://typedb.com/docs/typedb/connecting/studio) by downloading the needed color scheme files from the corresponding [resource directory](https://github.com/typedb-osi/typeql-plugin-jetbrains/tree/master/src/main/resources) and importing it in the IDE via `Preferences → Editor → Color Scheme → Import Scheme`.
## Information
diff --git a/build.gradle.kts b/build.gradle.kts
index e7f6bf3..5311f43 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -4,7 +4,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun properties(key: String) = project.findProperty(key).toString()
plugins {
- id("antlr")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.9.10"
// Gradle IntelliJ Plugin
@@ -21,11 +20,12 @@ version = properties("pluginVersion")
// Configure project's dependencies
repositories {
mavenCentral()
+ maven(url = "https://repo.typedb.com/public/public-release/maven/")
}
dependencies {
- antlr("org.antlr:antlr4:4.7.1")
implementation("org.antlr:antlr4-intellij-adaptor:0.1")
+ implementation("com.vaticle.typeql:typeql-grammar:2.26.6")
}
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
@@ -122,11 +122,4 @@ tasks {
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
}
-
- generateGrammarSource {
- outputDirectory = file("build/generated-src/antlr/main/org/typedb/typeql/plugin/jetbrains")
- arguments = mutableListOf("-package", "org.typedb.typeql.plugin.jetbrains", "-visitor")
- }
- getByName("compileKotlin").dependsOn("generateGrammarSource")
- getByName("compileTestKotlin").dependsOn("generateTestGrammarSource")
}
diff --git a/gradle.properties b/gradle.properties
index b0e0b52..72a17d1 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -3,7 +3,7 @@
pluginGroup = org.typedb.typeql.plugin.jetbrains
pluginName = typeql-plugin-jetbrains
-pluginVersion = 0.1.2
+pluginVersion = 0.2.0
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
diff --git a/src/main/antlr/TypeQL.g4 b/src/main/antlr/TypeQL.g4
deleted file mode 100644
index 8722eb2..0000000
--- a/src/main/antlr/TypeQL.g4
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (C) 2022 Vaticle
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-grammar TypeQL;
-
-// TypeQL end-of-file (aka. end-of-string) query parser
-// Needed by TypeQL's Parser to ensure that it parses till end of string
-
-eof_query : query EOF ;
-eof_queries : query+ EOF ;
-eof_pattern : pattern EOF ;
-eof_patterns : patterns EOF ;
-eof_definables : definables EOF ;
-eof_variable : pattern_variable EOF ;
-eof_label : label EOF ;
-eof_schema_rule : schema_rule EOF ;
-
-// TYPEQL QUERY LANGUAGE =======================================================
-
-query : query_define | query_undefine
- | query_insert | query_update
- | query_delete | query_match
- | query_match_aggregate | query_match_group
- | query_match_group_agg ;
-
-query_define : DEFINE definables ;
-query_undefine : UNDEFINE definables ;
-
-query_insert : MATCH patterns INSERT variable_things
- | INSERT variable_things ;
-query_update : query_delete INSERT variable_things ;
-query_delete : MATCH patterns DELETE variable_things ;
-
-query_match : MATCH patterns ( modifiers ) ;
-
-// MATCH QUERY ANSWER GROUP AND AGGREGATE FUNCTIONS ============================
-
-query_match_aggregate : query_match match_aggregate ;
-query_match_group : query_match match_group ;
-query_match_group_agg : query_match match_group match_aggregate ;
-
-// MATCH QUERY MODIFIERS =======================================================
-
-modifiers : ( filter ';' )? ( sort ';' )? ( offset ';' )? ( limit ';' )? ;
-
-filter : GET (VAR_CONCEPT_ | VAR_VALUE_) ( ',' (VAR_CONCEPT_ | VAR_VALUE_) )* ;
-sort : SORT var_order ( ',' var_order )* ;
-var_order : (VAR_CONCEPT_ | VAR_VALUE_) ORDER_? ;
-offset : OFFSET LONG_ ;
-limit : LIMIT LONG_ ;
-
-// GET AGGREGATE QUERY =========================================================
-//
-// An aggregate function is composed of 2 things:
-// The aggregate method name, followed by the variable to apply the function to
-
-match_aggregate : aggregate_method (VAR_CONCEPT_ | VAR_VALUE_)? ';' ; // method and, optionally, a variable
-aggregate_method : COUNT | MAX | MEAN | MEDIAN // calculate statistical values
- | MIN | STD | SUM ;
-
-// GET GROUP QUERY =============================================================
-//
-// An group function is composed of 2 things:
-// The 'GROUP' method name, followed by the variable to group the results by
-
-match_group : GROUP (VAR_CONCEPT_ | VAR_VALUE_) ';' ;
-
-// SCHEMA QUERY ================================================================
-
-definables : ( definable ';' )+ ;
-definable : variable_type
- | schema_rule ;
-
-// QUERY PATTERNS ==============================================================
-
-patterns : ( pattern ';' )+ ;
-pattern : pattern_variable
- | pattern_conjunction
- | pattern_disjunction
- | pattern_negation
- ;
-pattern_conjunction : '{' patterns '}' ;
-pattern_disjunction : '{' patterns '}' ( OR '{' patterns '}' )+ ;
-pattern_negation : NOT '{' patterns '}' ;
-
-// VARIABLE PATTERNS ===========================================================
-
-pattern_variable : variable_concept
- | variable_type
- | variable_thing_any
- | variable_value
- ;
-
-// CONCEPT VARAIBLES ===========================================================
-
-variable_concept : VAR_CONCEPT_ IS VAR_CONCEPT_ ;
-
-// TYPE VARIABLES ==============================================================
-
-variable_type : type_any type_constraint ( ',' type_constraint )* ;
-type_constraint : ABSTRACT
- | SUB_ type_any
- | OWNS type ( AS type )? annotations_owns
- | RELATES type ( AS type )?
- | PLAYS type_scoped ( AS type )?
- | VALUE value_type
- | REGEX STRING_
- | TYPE label_any
- ;
-
-annotations_owns : ( ANNOTATION_KEY )? ( ANNOTATION_UNIQUE )? ;
-
-// VALUE VARIABLES =============================================================
-
-variable_value : VAR_VALUE_ ASSIGN expression
- | VAR_VALUE_ predicate
- ;
-
-// THING VARIABLES =============================================================
-
-variable_things : ( variable_thing_any ';' )+ ;
-variable_thing_any : variable_thing
- | variable_relation
- | variable_attribute
- ;
-variable_thing : VAR_CONCEPT_ ISA_ type ( ',' attributes )?
- | VAR_CONCEPT_ IID IID_ ( ',' attributes )?
- | VAR_CONCEPT_ attributes
- ;
-variable_relation : VAR_CONCEPT_? relation ISA_ type ( ',' attributes )?
- | VAR_CONCEPT_? relation attributes?
- ;
-variable_attribute : VAR_CONCEPT_? predicate ISA_ type ( ',' attributes )?
- | VAR_CONCEPT_? predicate attributes?
- ;
-
-// RELATION CONSTRUCT ==========================================================
-
-relation : '(' role_player ( ',' role_player )* ')' ; // A list of role players in a Relations
-role_player : type ':' player // The Role type and and player variable
- | player ; // Or just the player variable
-player : VAR_CONCEPT_ ; // A player is just a variable
-
-// ATTRIBUTE CONSTRUCT =========================================================
-
-attributes : attribute ( ',' attribute )* ;
-attribute : HAS label ( VAR_CONCEPT_ | VAR_VALUE_ | predicate ) // ownership by labeled variable or value
- | HAS VAR_CONCEPT_ ; // or just value
-
-// PREDICATE CONSTRUCTS ========================================================
-
-predicate : value
- | predicate_equality predicate_value
- | predicate_substring STRING_
- ;
-predicate_equality : EQ | NEQ | GT | GTE | LT | LTE
- | ASSIGN ; // Backwards compatibility till 3.0
-predicate_substring : CONTAINS | LIKE ;
-
-predicate_value : value | VAR_CONCEPT_ | VAR_VALUE_ ;
-
-// EXPRESSION CONSTRUCTS =======================================================
-
-expression : expression POWER expression // exponentiation is right-associative
- | expression (MULTIPLY | DIVIDE | MODULO) expression
- | expression (ADD | SUBTRACT) expression
- | expression_base
- ;
-expression_base : VAR_CONCEPT_ | VAR_VALUE_
- | expression_function | value
- | '(' expression ')'
- ;
-expression_function : expression_function_name '(' expression_arguments? ')' ;
-expression_function_name : EXPR_FUNC_NAME | MAX | MIN ;
-expression_arguments : expression (',' expression)* ;
-
-// SCHEMA CONSTRUCT ============================================================
-
-schema_rule : RULE label
- | RULE label ':' WHEN '{' patterns '}' THEN '{' variable_thing_any ';' '}' ;
-
-// TYPE, LABEL AND IDENTIFIER CONSTRUCTS =======================================
-
-type_any : type_scoped | type | VAR_CONCEPT_ ;
-type_scoped : label_scoped | VAR_CONCEPT_ ;
-type : label | VAR_CONCEPT_ ; // A type can be a label or variable
-
-label_any : label_scoped | label ;
-label_scoped : LABEL_SCOPED_ ;
-label : LABEL_ | type_native | unreserved ;
-
-// LITERAL INPUT VALUES ========================================================
-
-type_native : THING | ENTITY | ATTRIBUTE
- | RELATION | ROLE ;
-
-value_type : LONG | DOUBLE | STRING
- | BOOLEAN | DATETIME ;
-value : STRING_ | BOOLEAN_
- | DATE_ | DATETIME_
- | signed_long | signed_double ;
-
-signed_long : sign? LONG_ ;
-signed_double : sign? DOUBLE_ ;
-sign : ADD | SUBTRACT ;
-
-// UNRESERVED KEYWORDS =========================================================
-// Most of TypeQL syntax should not be reserved from being used as identifiers
-
-unreserved : VALUE | EXPR_FUNC_NAME
- | MIN | MAX | MEDIAN | MEAN | STD | SUM | COUNT
- | GET | SORT | LIMIT | OFFSET | GROUP | CONTAINS
- | RULE
- ;
-
-// TYPEQL SYNTAX KEYWORDS =======================================================
-
-// QUERY COMMAND KEYWORDS
-
-MATCH : 'match' ; GET : 'get' ;
-DEFINE : 'define' ; UNDEFINE : 'undefine' ;
-INSERT : 'insert' ; DELETE : 'delete' ;
-COMPUTE : 'compute' ;
-
-// NATIVE TYPE KEYWORDS
-
-THING : 'thing' ; ENTITY : 'entity' ;
-ATTRIBUTE : 'attribute' ; RELATION : 'relation' ;
-ROLE : 'role' ; RULE : 'rule' ;
-
-// DELETE AND GET QUERY MODIFIER KEYWORDS
-
-OFFSET : 'offset' ; LIMIT : 'limit' ;
-SORT : 'sort' ; ORDER_ : ASC | DESC ;
-ASC : 'asc' ; DESC : 'desc' ;
-
-// TYPE VARIABLE CONSTRAINT KEYWORDS
-
-TYPE : 'type' ;
-ABSTRACT : 'abstract' ; SUB_ : SUB | SUBX ;
-SUB : 'sub' ; SUBX : 'sub!' ;
-OWNS : 'owns' ;
-REGEX : 'regex' ; AS : 'as' ;
-PLAYS : 'plays' ; RELATES : 'relates' ;
-WHEN : 'when' ; THEN : 'then' ;
-
-// TYPE ANNOTATIONS
-
-ANNOTATION_KEY : '@key';
-ANNOTATION_UNIQUE : '@unique';
-
-// THING VARIABLE CONSTRAINT KEYWORDS
-
-IID : 'iid' ; ISA_ : ISA | ISAX ;
-ISA : 'isa' ; ISAX : 'isa!' ;
-HAS : 'has' ; VALUE : 'value' ;
-IS : 'is' ;
-
-// OPERATOR KEYWORDS
-
-OR : 'or' ; NOT : 'not' ;
-
-// PREDICATE KEYWORDS
-
-EQ : '==' ; NEQ : '!=' ;
-GT : '>' ; GTE : '>=' ;
-LT : '<' ; LTE : '<=' ;
-LIKE : 'like' ; CONTAINS : 'contains' ;
-
-// ASSIGNMENT AND EXPRESSION KEYWORDS
-
-ASSIGN : '=' ;
-ADD : '+' ; SUBTRACT : '-' ;
-DIVIDE : '/' ; MULTIPLY : '*' ;
-POWER : '^' ; MODULO : '%' ;
-PAREN_OPEN : '(' ; PAREN_CLOSE : ')' ;
-
-// Incomplete list of function names usable in expressions. The 'expression_function_name' rule references all function names.
-EXPR_FUNC_NAME : 'floor' | 'ceil' | 'round' | 'abs' ;
-
-// GROUP AND AGGREGATE QUERY KEYWORDS (also used by COMPUTE QUERY)
-
-GROUP : 'group' ; COUNT : 'count' ;
-MAX : 'max' ; MIN : 'min' ;
-MEAN : 'mean' ; MEDIAN : 'median' ;
-STD : 'std' ; SUM : 'sum' ;
-
-// VALUE TYPE KEYWORDS
-
-LONG : 'long' ; DOUBLE : 'double' ;
-STRING : 'string' ; BOOLEAN : 'boolean' ;
-DATETIME : 'datetime' ;
-
-// LITERAL VALUE KEYWORDS
-BOOLEAN_ : TRUE | FALSE ; // order of lexer declaration matters
-TRUE : 'true' ;
-FALSE : 'false' ;
-STRING_ : '"' (~["\\] | ESCAPE_SEQ_ )* '"'
- | '\'' (~['\\] | ESCAPE_SEQ_ )* '\'' ;
-LONG_ : [0-9]+ ;
-DOUBLE_ : [0-9]+ '.' [0-9]+ ;
-DATE_ : DATE_FRAGMENT_ ;
-DATETIME_ : DATE_FRAGMENT_ 'T' TIME_ ;
-
-// TYPEQL INPUT TOKEN PATTERNS
-// All token names must end with an underscore ('_')
-
-VAR_CONCEPT_ : VAR_CONCEPT_ANONYMOUS_ | VAR_CONCEPT_NAMED_ ;
-VAR_CONCEPT_ANONYMOUS_ : '$_' ;
-VAR_CONCEPT_NAMED_ : '$' [a-zA-Z0-9][a-zA-Z0-9_-]* ;
-VAR_VALUE_ : '?' [a-zA-Z0-9][a-zA-Z0-9_-]* ;
-IID_ : '0x' [0-9a-f]+ ;
-LABEL_ : TYPE_CHAR_H_ TYPE_CHAR_T_* ;
-LABEL_SCOPED_ : LABEL_ ':' LABEL_ ;
-
-// FRAGMENTS OF KEYWORDS =======================================================
-
-fragment TYPE_CHAR_H_ : 'A'..'Z' | 'a'..'z'
- | '\u00C0'..'\u00D6'
- | '\u00D8'..'\u00F6'
- | '\u00F8'..'\u02FF'
- | '\u0370'..'\u037D'
- | '\u037F'..'\u1FFF'
- | '\u200C'..'\u200D'
- | '\u2070'..'\u218F'
- | '\u2C00'..'\u2FEF'
- | '\u3001'..'\uD7FF'
- | '\uF900'..'\uFDCF'
- | '\uFDF0'..'\uFFFD'
- ;
-fragment TYPE_CHAR_T_ : TYPE_CHAR_H_
- | '0'..'9'
- | '_'
- | '-'
- | '\u00B7'
- | '\u0300'..'\u036F'
- | '\u203F'..'\u2040'
- ;
-fragment DATE_FRAGMENT_ : YEAR_ '-' MONTH_ '-' DAY_ ;
-fragment MONTH_ : [0-1][0-9] ;
-fragment DAY_ : [0-3][0-9] ;
-fragment YEAR_ : [0-9][0-9][0-9][0-9] | ('+' | '-') [0-9]+ ;
-fragment TIME_ : HOUR_ ':' MINUTE_ (':' SECOND_ ('.' SECOND_FRACTION_)? )? ;
-fragment HOUR_ : [0-2][0-9] ;
-fragment MINUTE_ : [0-6][0-9] ;
-fragment SECOND_ : [0-6][0-9] ;
-fragment SECOND_FRACTION_ : [0-9] ([0-9] ([0-9])?)?; // between 1 and 3 digits
-fragment ESCAPE_SEQ_ : '\\' . ;
-
-COMMENT : '#' .*? '\r'? ('\n' | EOF) -> channel(HIDDEN) ;
-WS : [ \t\r\n]+ -> channel(HIDDEN) ;
-UNRECOGNISED : . ;
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLFileType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLFileType.kt
index 0e8b491..61191b6 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLFileType.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLFileType.kt
@@ -1,7 +1,27 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains
import com.intellij.openapi.fileTypes.LanguageFileType
-import com.intellij.openapi.util.IconLoader
import javax.swing.Icon
/**
@@ -9,26 +29,24 @@ import javax.swing.Icon
*/
class TypeQLFileType private constructor() : LanguageFileType(TypeQLLanguage.INSTANCE) {
override fun getName(): String {
- return "TypeQL"
+ return LANG_NAME
}
override fun getDescription(): String {
- return "TypeQL file"
+ return "$LANG_NAME file"
}
override fun getDefaultExtension(): String {
- return "tql"
+ return EXTENSION
}
override fun getIcon(): Icon {
- return IconLoader.findIcon("/icons/typedb.svg", TypeQLFileType::class.java.classLoader)!!
- }
-
- object Util {
- val INSTANCE = TypeQLFileType()
+ return TypeQLIcons.ICON
}
companion object {
- val INSTANCE = Util.INSTANCE //todo: idk why this is needed
+ val INSTANCE: TypeQLFileType = TypeQLFileType()
+ const val LANG_NAME: String = "TypeQL"
+ const val EXTENSION: String = "tql"
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLIcons.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLIcons.kt
new file mode 100644
index 0000000..bb93f36
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLIcons.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains
+
+import com.intellij.openapi.util.IconLoader
+
+class TypeQLIcons {
+ companion object {
+ val ICON = IconLoader.findIcon("/icons/typedb.svg", TypeQLFileType::class.java.classLoader)!!
+ }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLLanguage.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLLanguage.kt
index a269509..2bd56ec 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLLanguage.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLLanguage.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains
import com.google.common.collect.ImmutableSet
@@ -6,9 +27,18 @@ import com.intellij.lang.Language
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
*/
-class TypeQLLanguage : Language("TypeQL") {
+class TypeQLLanguage : Language(TypeQLFileType.LANG_NAME) {
companion object {
val INSTANCE: TypeQLLanguage = TypeQLLanguage()
- val GRAQL_TYPES: Set = ImmutableSet.of("attribute", "entity", "relation", "rule", "role", "thing")
+
+ // TODO: Move to ParserDefinition and connect with the Parser's tokens
+ val TYPEQL_TYPES: Set = ImmutableSet.of(
+ "attribute",
+ "entity",
+ "relation",
+ "rule",
+ "role",
+ "thing"
+ )
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLParserDefinition.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLParserDefinition.kt
index 6908aaf..a3bee0e 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLParserDefinition.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLParserDefinition.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains
import com.intellij.lang.ASTNode
@@ -13,17 +34,21 @@ import com.intellij.psi.impl.source.tree.CompositeElement
import com.intellij.psi.tree.IElementType
import com.intellij.psi.tree.IFileElementType
import com.intellij.psi.tree.TokenSet
-import org.typedb.typeql.plugin.jetbrains.completion.TypeQLCompletionErrorListener
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLFileBase
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.*
-import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
+import com.vaticle.typeql.grammar.TypeQLLexer
+import com.vaticle.typeql.grammar.TypeQLParser
import org.antlr.intellij.adaptor.lexer.ANTLRLexerAdaptor
import org.antlr.intellij.adaptor.lexer.PSIElementTypeFactory
import org.antlr.intellij.adaptor.lexer.RuleIElementType
+import org.antlr.intellij.adaptor.lexer.TokenIElementType
import org.antlr.intellij.adaptor.parser.ANTLRParserAdaptor
import org.antlr.v4.runtime.Parser
import org.antlr.v4.runtime.tree.ParseTree
+import org.typedb.typeql.plugin.jetbrains.completion.TypeQLCompletionErrorListener
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLFile
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLStatementType
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLUtils
+import org.typedb.typeql.plugin.jetbrains.psi.constraint.*
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
@@ -38,9 +63,9 @@ class TypeQLParserDefinition : ParserDefinition {
return ANTLRLexerAdaptor(TypeQLLanguage.INSTANCE, lexer)
}
- override fun getWhitespaceTokens(): TokenSet = WHITESPACE
- override fun getCommentTokens(): TokenSet = COMMENTS
- override fun getStringLiteralElements(): TokenSet = STRING
+ override fun getWhitespaceTokens(): TokenSet = TypeQLTokenSets.WHITESPACES
+ override fun getCommentTokens(): TokenSet = TypeQLTokenSets.COMMENTS
+ override fun getStringLiteralElements(): TokenSet = TypeQLTokenSets.STRINGS
override fun createParser(project: Project): PsiParser {
val parser = TypeQLParser(null)
@@ -48,6 +73,7 @@ class TypeQLParserDefinition : ParserDefinition {
return object : ANTLRParserAdaptor(TypeQLLanguage.INSTANCE, parser) {
override fun parse(parser: Parser, root: IElementType): ParseTree {
parser.addErrorListener(completionErrorListener)
+
if (root is IFileElementType) {
return (parser as TypeQLParser).eof_queries()
}
@@ -58,38 +84,33 @@ class TypeQLParserDefinition : ParserDefinition {
override fun getFileNodeType(): IFileElementType = FILE
- override fun createFile(viewProvider: FileViewProvider): PsiFile = PsiTypeQLFileBase(viewProvider)
+ override fun createFile(viewProvider: FileViewProvider): PsiFile = PsiTypeQLFile(viewProvider)
override fun createElement(node: ASTNode): PsiElement {
- val ruleElType = node.elementType as RuleIElementType
- return when (ruleElType.ruleIndex) {
- TypeQLParser.RULE_variable_type -> updateWrappedTypeIfNecessary(
- node,
- PsiStatementType(node)
- )
- TypeQLParser.RULE_type_constraint -> {
- val ruleTypePropertyElement = getRuleTypePropertyElement(node)
- if (ruleTypePropertyElement != null) {
- return updateWrappedTypeIfNecessary(node, ruleTypePropertyElement)
- }
- val ruleTypeElement = getRuleTypeElement(node)
- if (ruleTypeElement != null) {
- updateWrappedTypeIfNecessary(node, ruleTypeElement)
- } else updateWrappedTypeIfNecessary(node, PsiTypeQLElement(node))
- }
- TypeQLParser.RULE_type -> {
- val ruleTypeElement = getRuleTypeElement(node)
- if (ruleTypeElement != null) {
- updateWrappedTypeIfNecessary(node, ruleTypeElement)
- } else updateWrappedTypeIfNecessary(node, PsiTypeQLElement(node))
- }
- else -> updateWrappedTypeIfNecessary(node, PsiTypeQLElement(node))
+ val elType: IElementType = node.elementType
+
+ if (elType is TokenIElementType) {
+ return createBasePsiElement(node)
+ }
+
+ if (elType !is RuleIElementType) {
+ return createBasePsiElement(node)
}
+
+ return updateWrappedTypeIfNecessary(
+ node,
+ when (elType.ruleIndex) {
+ TypeQLParser.RULE_statement_type -> PsiTypeQLStatementType(node)
+ TypeQLParser.RULE_type_constraint -> createTypeConstraintWrapper(node)
+ TypeQLParser.RULE_type -> createTypeWrapper(node)
+ else -> createBasePsiElement(node)
+ }
+ )
}
companion object {
- private var WRAPPER_SET = Key("typeql.wrapper")
lateinit var INSTANCE: TypeQLParserDefinition
+ private var WRAPPER_SET = Key("typeql.wrapper")
init {
PSIElementTypeFactory.defineLanguageIElementTypes(
@@ -98,61 +119,162 @@ class TypeQLParserDefinition : ParserDefinition {
}
val FILE = IFileElementType(TypeQLLanguage.INSTANCE)
- val IDS = PSIElementTypeFactory.createTokenSet(TypeQLLanguage.INSTANCE, TypeQLParser.LABEL_)!!
- val COMMENTS = PSIElementTypeFactory.createTokenSet(TypeQLLanguage.INSTANCE, TypeQLLexer.COMMENT)!!
- val WHITESPACE = PSIElementTypeFactory.createTokenSet(TypeQLLanguage.INSTANCE, TypeQLLexer.WS)!!
- val STRING = PSIElementTypeFactory.createTokenSet(TypeQLLanguage.INSTANCE, TypeQLLexer.STRING_)!!
- val TOKEN_ELEMENT_TYPES = PSIElementTypeFactory.getTokenIElementTypes(TypeQLLanguage.INSTANCE)!!
- val RULE_ELEMENT_TYPES = PSIElementTypeFactory.getRuleIElementTypes(TypeQLLanguage.INSTANCE)!!
-
- fun getRuleTypeElement(node: ASTNode): PsiTypeQLElement? {
- if (node.treePrev != null && node.treePrev.treePrev != null && node.treePrev.treePrev.text == "as") {
- return PsiRelatesSuperRoleTypeConstraint(node)
- } else if (node.treeParent != null
- && node.treeParent.treeNext != null
- && node.treeParent.treeNext.treeNext != null
- && node.treeParent.treeNext.treeNext.firstChildNode != null
- && node.treeParent.treeNext.treeNext.firstChildNode.text == "sub"
- && node.firstChildNode != null
- && node.firstChildNode.elementType === RULE_ELEMENT_TYPES[TypeQLParser.RULE_label]
- ) {
- return PsiTypeConstraint(node)
+
+ private val TOKEN_ELEMENT_TYPES: List =
+ PSIElementTypeFactory.getTokenIElementTypes(TypeQLLanguage.INSTANCE)!!
+ private val RULE_ELEMENT_TYPES: List =
+ PSIElementTypeFactory.getRuleIElementTypes(TypeQLLanguage.INSTANCE)!!
+
+ fun getRule(ruleId: Int): RuleIElementType? {
+ return if (ruleId < RULE_ELEMENT_TYPES.size) {
+ RULE_ELEMENT_TYPES[ruleId]
+ } else {
+ null
+ }
+ }
+
+ fun getToken(tokenId: Int): TokenIElementType? {
+ return if (tokenId < TOKEN_ELEMENT_TYPES.size) {
+ TOKEN_ELEMENT_TYPES[tokenId]
+ } else {
+ null
}
- return null
}
- fun getRuleTypePropertyElement(node: ASTNode): PsiTypeQLElement? {
- if (node.firstChildNode != null && (node.firstChildNode.text == "owns" || node.firstChildNode.text == "key")) {
- val ownsTo = node.lastChildNode.text
- if (ownsTo.isNotEmpty()) {
- return PsiOwnsTypeConstraint(node)
+ fun getTokenText(tokenId: Int): String {
+ return (getToken(tokenId) ?: "").toString()
+ }
+
+ fun checkNode(node: ASTNode?, elementId: Int): Boolean {
+ if (node?.elementType is TokenIElementType) {
+ return refCheckInContainer(node, TOKEN_ELEMENT_TYPES, elementId)
+ }
+ if (node?.elementType is RuleIElementType) {
+ return refCheckInContainer(node, RULE_ELEMENT_TYPES, elementId)
+ }
+
+ return false
+ }
+
+ fun getRuleTypeElement(node: ASTNode): PsiElement? {
+ if (checkNode(node.treePrev?.treePrev, TypeQLParser.AS)) {
+ if (checkNode(node.treeParent?.firstChildNode, TypeQLParser.OWNS)) {
+ return PsiTypeQLOwnsAsOverrideType(node)
}
- } else if (node.firstChildNode != null && node.firstChildNode.text == "plays") {
- val playsTo = node.lastChildNode.text
- if (playsTo.isNotEmpty()) {
- return PsiPlaysTypeConstraint(node)
+
+ if (checkNode(node.treeParent?.firstChildNode, TypeQLParser.PLAYS)) {
+ return PsiTypeQLPlaysAsOverrideType(node)
}
- } else if (node.firstChildNode != null && node.firstChildNode.text == "relates") {
- val relatesTo = node.lastChildNode.text
- if (relatesTo.isNotEmpty()) {
- return PsiRelatesTypeConstraint(node)
+
+ if (checkNode(node.treeParent?.firstChildNode, TypeQLParser.RELATES)) {
+ return PsiTypeQLRelatesAsOverrideType(node)
}
- } else if (node.firstChildNode != null && node.firstChildNode.text == "sub") {
- val subsTo = node.lastChildNode.text
- if (subsTo.isNotEmpty() && !TypeQLLanguage.GRAQL_TYPES.contains(subsTo)) {
- return PsiSubTypeConstraint(node)
+ }
+
+ if (checkNode(node.treeParent?.treeNext?.treeNext?.firstChildNode, TypeQLParser.SUB_)
+ && checkNode(node.firstChildNode, TypeQLParser.RULE_label)
+ ) {
+ return PsiTypeQLType(node)
+ }
+
+ return null
+ }
+
+ private fun getRuleTypePropertyElement(node: ASTNode): PsiElement? {
+ var newNode: PsiElement? = null
+
+ if (node.firstChildNode != null) {
+ if (checkNode(node.firstChildNode, TypeQLParser.OWNS)) {
+ newNode = createOwnsType(node)
+ } else if (checkNode(node.firstChildNode, TypeQLParser.PLAYS)) {
+ newNode = createPlaysType(node)
+ } else if (checkNode(node.firstChildNode, TypeQLParser.RELATES)) {
+ newNode = createRelatesType(node)
+ } else if (checkNode(node.firstChildNode, TypeQLParser.SUB_)) {
+ newNode = createSubType(node)
}
}
+
+ return newNode
+ }
+
+ private fun createOwnsType(node: ASTNode): PsiTypeQLOwnsType? {
+ val annotationNode = node.lastChildNode
+ var ownsToNode = annotationNode?.treePrev
+
+ while (isWhiteSpace(ownsToNode)) {
+ ownsToNode = ownsToNode!!.treePrev
+ }
+
+ val ownsTo = ownsToNode?.text
+ if (!ownsTo.isNullOrEmpty()) {
+ return PsiTypeQLOwnsType(node)
+ }
+
return null
}
- fun updateWrappedTypeIfNecessary(node: ASTNode, element: PsiTypeQLElement): PsiTypeQLElement {
+ private fun createPlaysType(node: ASTNode): PsiTypeQLPlaysType? {
+ val playsTo = node.lastChildNode?.text
+
+ if (!playsTo.isNullOrEmpty()) {
+ return PsiTypeQLPlaysType(node)
+ }
+
+ return null
+ }
+
+ private fun createRelatesType(node: ASTNode): PsiTypeQLRelatesType? {
+ val relatesTo = node.lastChildNode?.text
+
+ if (!relatesTo.isNullOrEmpty()) {
+ return PsiTypeQLRelatesType(node)
+ }
+
+ return null
+ }
+
+ private fun createSubType(node: ASTNode): PsiTypeQLSubType? {
+ val subsTo = node.lastChildNode?.text
+
+ if (!subsTo.isNullOrEmpty() && !TypeQLLanguage.TYPEQL_TYPES.contains(subsTo)) {
+ // PsiTypeQLType is not reparsed without extra changes, so we update it manually after finding a "sub":
+ PsiTypeQLUtils.ensureTypeQLElementsUpToDate(node.treePrev?.treePrev?.firstChildNode?.psi)
+ return PsiTypeQLSubType(node)
+ }
+
+ return null
+ }
+
+ private fun createBasePsiElement(node: ASTNode): PsiElement {
+ return PsiTypeQLElement(node)
+ }
+
+ private fun createTypeConstraintWrapper(node: ASTNode): PsiElement {
+ return getRuleTypePropertyElement(node) ?: createTypeWrapper(node)
+ }
+
+ private fun createTypeWrapper(node: ASTNode): PsiElement {
+ return getRuleTypeElement(node) ?: createBasePsiElement(node)
+ }
+
+ private fun refCheckInContainer(node: ASTNode, container: List, index: Int): Boolean {
+ return if (index < container.size) node.elementType === container[index] else false
+ }
+
+ private fun isWhiteSpace(node: ASTNode?): Boolean {
+ return checkNode(node, TypeQLParser.WS)
+ }
+
+ fun updateWrappedTypeIfNecessary(node: ASTNode, element: PsiElement): PsiElement {
val composite = node as CompositeElement
val wrapperSet = composite.getUserData(WRAPPER_SET)
+
if (wrapperSet == null || wrapperSet && element.javaClass != composite.psi.javaClass) {
composite.psi = element
composite.putUserData(WRAPPER_SET, true)
}
+
return element
}
}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLTokenSets.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLTokenSets.kt
new file mode 100644
index 0000000..beac994
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLTokenSets.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains
+
+import com.vaticle.typeql.grammar.TypeQLLexer
+import org.antlr.intellij.adaptor.lexer.PSIElementTypeFactory
+
+class TypeQLTokenSets {
+ companion object {
+ val IDENTIFIERS = PSIElementTypeFactory.createTokenSet(TypeQLLanguage.INSTANCE, TypeQLLexer.LABEL_)!!
+ val COMMENTS = PSIElementTypeFactory.createTokenSet(TypeQLLanguage.INSTANCE, TypeQLLexer.COMMENT)!!
+ val WHITESPACES = PSIElementTypeFactory.createTokenSet(TypeQLLanguage.INSTANCE, TypeQLLexer.WS)!!
+ val STRINGS = PSIElementTypeFactory.createTokenSet(TypeQLLanguage.INSTANCE, TypeQLLexer.QUOTED_STRING)!!
+ }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/completion/TypeQLCompletionContributor.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/completion/TypeQLCompletionContributor.kt
index 73f70b3..955d772 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/completion/TypeQLCompletionContributor.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/completion/TypeQLCompletionContributor.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.completion
import com.google.common.collect.ImmutableSet
@@ -13,18 +34,18 @@ import com.intellij.psi.search.FileTypeIndex
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.util.ProcessingContext
-import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
-import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
-import org.typedb.typeql.plugin.jetbrains.TypeQLParser
-import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiOwnsTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiPlaysTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiRelatesTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiSubTypeConstraint
+import com.vaticle.typeql.grammar.TypeQLParser
import org.antlr.intellij.adaptor.parser.SyntaxError
import org.antlr.v4.runtime.misc.IntervalSet
import org.jetbrains.annotations.NonNls
+import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
+import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLUtils
+import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiTypeQLOwnsType
+import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiTypeQLPlaysType
+import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiTypeQLRelatesType
+import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiTypeQLSubType
import java.util.function.Consumer
import java.util.stream.Collectors
@@ -42,36 +63,36 @@ class TypeQLCompletionContributor : CompletionContributor() {
resultSet: CompletionResultSet
) {
var includeKeywords = true
- val ruleType = TypeQLPsiUtils.findParentByType(
+ val ruleType = PsiTypeQLUtils.findParentByType(
parameters.position,
- TypeQLParserDefinition.RULE_ELEMENT_TYPES[TypeQLParser.RULE_type_constraint]
+ TypeQLParserDefinition.getRule(TypeQLParser.RULE_type_constraint)!!
)
if (ruleType != null) {
- if (ruleType is PsiOwnsTypeConstraint) {
+ if (ruleType is PsiTypeQLOwnsType) {
//owns, include all attributes
- val statementType = TypeQLPsiUtils.findParentByType(
+ val statementType = PsiTypeQLUtils.findParentByType(
parameters.position,
- TypeQLParserDefinition.RULE_ELEMENT_TYPES[TypeQLParser.RULE_variable_type]
+ TypeQLParserDefinition.getRule(TypeQLParser.RULE_statement_type)!!
)
includeAttributeTypes(
resultSet, ruleType, parameters.originalFile.virtualFile,
statementType!!.name!!
)
- } else if (ruleType is PsiSubTypeConstraint) {
+ } else if (ruleType is PsiTypeQLSubType) {
//sub, include all declarations & base types
- val statementType = TypeQLPsiUtils.findParentByType(
+ val statementType = PsiTypeQLUtils.findParentByType(
parameters.position,
- TypeQLParserDefinition.RULE_ELEMENT_TYPES[TypeQLParser.RULE_variable_type]
+ TypeQLParserDefinition.getRule(TypeQLParser.RULE_statement_type)!!
)
includeAllTypes(
resultSet, ruleType, parameters.originalFile.virtualFile,
statementType!!.name!!
)
includeBaseTypes(resultSet)
- } else if (ruleType is PsiRelatesTypeConstraint) {
+ } else if (ruleType is PsiTypeQLRelatesType) {
//relates, include all plays (roles)
includePlayRoles(parameters, resultSet)
- } else if (ruleType is PsiPlaysTypeConstraint) {
+ } else if (ruleType is PsiTypeQLPlaysType) {
//plays, include all relates (roles)
includeRelateRoles(parameters, resultSet)
} else {
@@ -81,7 +102,7 @@ class TypeQLCompletionContributor : CompletionContributor() {
LookupElementBuilder.create(
keyword!!
)
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText(keyword)
.withBoldness(true)
)
@@ -91,12 +112,16 @@ class TypeQLCompletionContributor : CompletionContributor() {
//if looking for TYPE_NAME_ don't include keywords
if (parameters.position is LeafPsiElement) {
if ((parameters.position as LeafPsiElement).elementType ===
- TypeQLParserDefinition.TOKEN_ELEMENT_TYPES[TypeQLParser.LABEL_]
+ TypeQLParserDefinition.getToken(TypeQLParser.LABEL_)
) {
includeKeywords = false
}
}
}
+
+ if (includeKeywords) {
+ includeQueryTypes(resultSet)
+ }
if (includeKeywords) {
val tokenToErrorMap: Map = TypeQLCompletionErrorListener.tokenToErrorMap
var syntaxError = tokenToErrorMap[parameters.offset]
@@ -115,7 +140,7 @@ class TypeQLCompletionContributor : CompletionContributor() {
LookupElementBuilder.create(
keyword!!
)
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText(keyword)
.withBoldness(true)
)
@@ -135,22 +160,22 @@ class TypeQLCompletionContributor : CompletionContributor() {
containingFile: VirtualFile, vararg excludedNames: String
) {
val excludedNameSet: Set = Sets.newHashSet(*excludedNames)
- val searchScope: Collection
- searchScope = if (ScratchUtil.isScratch(containingFile)) {
+ val searchScope: Collection = if (ScratchUtil.isScratch(containingFile)) {
listOf(containingFile)
} else {
FileTypeIndex.getFiles(
- TypeQLFileType.Util.INSTANCE,
+ TypeQLFileType.INSTANCE,
GlobalSearchScope.allScope(ruleType.project)
)
}
- TypeQLPsiUtils.getDeclarationsByType(ruleType.project, searchScope, "attribute").stream()
+
+ PsiTypeQLUtils.getDeclarationsByType(ruleType.project, searchScope, "attribute").stream()
.filter { !excludedNameSet.contains(it.name) }
.forEach {
- val declarationType = TypeQLPsiUtils.determineDeclarationType(it)
+ val declarationType = PsiTypeQLUtils.determineDeclarationType(it)
resultSet.addElement(
LookupElementBuilder.create(it)
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText(declarationType ?: "unknown")
.withStrikeoutness(declarationType == null)
)
@@ -162,23 +187,23 @@ class TypeQLCompletionContributor : CompletionContributor() {
containingFile: VirtualFile, vararg excludedNames: String
) {
val excludedNameSet: Set = Sets.newHashSet(*excludedNames)
- val searchScope: Collection
- searchScope = if (ScratchUtil.isScratch(containingFile)) {
+ val searchScope: Collection = if (ScratchUtil.isScratch(containingFile)) {
listOf(containingFile)
} else {
FileTypeIndex.getFiles(
- TypeQLFileType.Util.INSTANCE,
+ TypeQLFileType.INSTANCE,
GlobalSearchScope.allScope(ruleType.project)
)
}
- TypeQLPsiUtils.getAllDeclarations(ruleType.project, searchScope).stream()
+
+ PsiTypeQLUtils.getAllDeclarations(ruleType.project, searchScope).stream()
.filter { !excludedNameSet.contains(it.name) }
.forEach {
- val declarationType = TypeQLPsiUtils.determineDeclarationType(it)
+ val declarationType = PsiTypeQLUtils.determineDeclarationType(it)
if (declarationType != null) {
resultSet.addElement(
LookupElementBuilder.create(it)
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText(declarationType)
)
}
@@ -186,12 +211,12 @@ class TypeQLCompletionContributor : CompletionContributor() {
}
private fun includeBaseTypes(resultSet: CompletionResultSet) {
- TypeQLLanguage.GRAQL_TYPES.forEach(Consumer {
+ TypeQLLanguage.TYPEQL_TYPES.forEach(Consumer {
resultSet.addElement(
LookupElementBuilder.create(
it!!
)
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText(it)
.withBoldness(true)
)
@@ -199,22 +224,22 @@ class TypeQLCompletionContributor : CompletionContributor() {
}
private fun includePlayRoles(parameters: CompletionParameters, resultSet: CompletionResultSet) {
- PsiTreeUtil.collectElementsOfType(parameters.originalFile, PsiPlaysTypeConstraint::class.java)
+ PsiTreeUtil.collectElementsOfType(parameters.originalFile, PsiTypeQLPlaysType::class.java)
.forEach(Consumer {
resultSet.addElement(
LookupElementBuilder.create(it.playsType!!)
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText("role")
)
})
}
private fun includeRelateRoles(parameters: CompletionParameters, resultSet: CompletionResultSet) {
- PsiTreeUtil.collectElementsOfType(parameters.originalFile, PsiRelatesTypeConstraint::class.java)
+ PsiTreeUtil.collectElementsOfType(parameters.originalFile, PsiTypeQLRelatesType::class.java)
.forEach(Consumer {
resultSet.addElement(
LookupElementBuilder.create(it.name!!)
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText("role")
)
})
@@ -223,31 +248,31 @@ class TypeQLCompletionContributor : CompletionContributor() {
private fun includeQueryTypes(resultSet: CompletionResultSet) {
resultSet.addElement(
LookupElementBuilder.create("define")
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText("define")
.withBoldness(true)
)
resultSet.addElement(
LookupElementBuilder.create("compute")
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText("compute")
.withBoldness(true)
)
resultSet.addElement(
LookupElementBuilder.create("insert")
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText("insert")
.withBoldness(true)
)
resultSet.addElement(
LookupElementBuilder.create("match")
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText("match")
.withBoldness(true)
)
resultSet.addElement(
LookupElementBuilder.create("undefine")
- .withIcon(TypeQLFileType.Util.INSTANCE.icon)
+ .withIcon(TypeQLFileType.INSTANCE.icon)
.withTypeText("undefine")
.withBoldness(true)
)
@@ -262,7 +287,7 @@ class TypeQLCompletionContributor : CompletionContributor() {
private fun getActualKeywords(keywordSet: IntervalSet): List {
return keywordSet.toList().stream()
.map {
- TypeQLParserDefinition.TOKEN_ELEMENT_TYPES[it!!].toString().replace("'", "")
+ TypeQLParserDefinition.getTokenText(it!!).replace("'", "")
}
.map { s: String ->
when (s) {
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/completion/TypeQLCompletionErrorListener.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/completion/TypeQLCompletionErrorListener.kt
index da40d2a..e441570 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/completion/TypeQLCompletionErrorListener.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/completion/TypeQLCompletionErrorListener.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.completion
import org.antlr.intellij.adaptor.parser.SyntaxError
@@ -22,4 +43,4 @@ class TypeQLCompletionErrorListener : SyntaxErrorListener() {
return tokenToErrorMap
}
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLColorSettingsPage.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLColorSettingsPage.kt
index 230996a..2caac0d 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLColorSettingsPage.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLColorSettingsPage.kt
@@ -1,15 +1,47 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.highlighter
-import com.intellij.openapi.editor.colors.ColorKey
import com.intellij.openapi.editor.colors.TextAttributesKey
import com.intellij.openapi.fileTypes.SyntaxHighlighter
import com.intellij.openapi.options.colors.AttributesDescriptor
import com.intellij.openapi.options.colors.ColorDescriptor
import com.intellij.openapi.options.colors.ColorSettingsPage
-import com.intellij.openapi.util.IconLoader
-import com.intellij.openapi.util.Pair
-import com.intellij.util.containers.ContainerUtil
-import java.awt.Color
+import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+import org.typedb.typeql.plugin.jetbrains.TypeQLIcons
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.ANNOTATION
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.BOOLEAN
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.DATE
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.FUNCTION
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.IID
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.KEYWORD
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.LABEL
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.LINE_COMMENT
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.NUMERIC
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.OPERATOR
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.STORAGE_MODIFIER
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.STORAGE_TYPE
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.STRING
+import org.typedb.typeql.plugin.jetbrains.highlighter.TypeQLSyntaxHighlighter.Companion.VARIABLE
import javax.swing.Icon
/**
@@ -17,10 +49,8 @@ import javax.swing.Icon
*/
class TypeQLColorSettingsPage : ColorSettingsPage {
- var testint = 1;
-
override fun getIcon(): Icon? {
- return IconLoader.findIcon("/icons/typedb.svg", TypeQLColorSettingsPage::class.java.classLoader)
+ return TypeQLIcons.ICON
}
override fun getHighlighter(): SyntaxHighlighter {
@@ -30,9 +60,12 @@ class TypeQLColorSettingsPage : ColorSettingsPage {
override fun getDemoText(): String {
return """define
-person sub entity, owns age, owns name;
- name sub attribute, value string;
- age sub attribute, value long;
+person sub entity,
+ owns id @key,
+ owns age,
+ owns name;
+name sub attribute, value string;
+age sub attribute, value long;
# Lorem ipsum dolor sit amet
match
@@ -43,11 +76,14 @@ ${"$"}c isa car, has reg-date < 2020-02-29T18:01:28.577;
${"$"}p has age = 4 + 4;
group ${"$"}p;
sort asc;
+
+# The resulting response copied here to show an IID:
+iid 0x826e800f8000000000000000 isa person => 1
"""
}
override fun getAdditionalHighlightingTagToDescriptorMap(): Map? {
- return ContainerUtil.newHashMap(Pair("Line Comment TEST", TypeQLSyntaxHighlighter.Companion.LINE_COMMENT))
+ return HashMap()
}
override fun getAttributeDescriptors(): Array {
@@ -59,38 +95,36 @@ sort asc;
}
override fun getDisplayName(): String {
- return "TypeQL"
+ return TypeQLFileType.LANG_NAME
}
companion object {
- private var ATTR_DESC = arrayOf(
- AttributesDescriptor("Line Comment", TypeQLSyntaxHighlighter.Companion.LINE_COMMENT),
- AttributesDescriptor("Keyword", TypeQLSyntaxHighlighter.Companion.KEYWORD),
- AttributesDescriptor("String", TypeQLSyntaxHighlighter.Companion.STRING),
- AttributesDescriptor("Number", TypeQLSyntaxHighlighter.Companion.NUMBER),
- AttributesDescriptor("Id", TypeQLSyntaxHighlighter.Companion.ID),
- AttributesDescriptor("Thing", TypeQLSyntaxHighlighter.Companion.THING),
- AttributesDescriptor("Var", TypeQLSyntaxHighlighter.Companion.VAR),
- AttributesDescriptor("Boolean", TypeQLSyntaxHighlighter.Companion.BOOLEAN),
- AttributesDescriptor("Aggregate", TypeQLSyntaxHighlighter.Companion.AGGREGATE),
- AttributesDescriptor("Type", TypeQLSyntaxHighlighter.Companion.TYPE),
- AttributesDescriptor("Annotation", TypeQLSyntaxHighlighter.Companion.ANNOTATION),
- //AttributesDescriptor("Bad Value", TypeQLSyntaxHighlighter.Companion.BAD_CHARACTER)
- )
- private val COLOR_DESC = arrayOf(
- ColorDescriptor("Line Comment", ColorKey.createColorKey("Green", Color(77, 201, 124)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Keyword", ColorKey.createColorKey("Pink", Color(255, 122, 189)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("String", ColorKey.createColorKey("Yellow", Color(255, 228, 167)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Number", ColorKey.createColorKey("Blue", Color(130, 182, 255)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Id", ColorKey.createColorKey("Light Purple", Color(213, 204, 255)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Thing", ColorKey.createColorKey("Cyan", Color(85, 234, 226)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Var", ColorKey.createColorKey("Cyan", Color(85, 234, 226)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Boolean", ColorKey.createColorKey("Orange", Color(255, 161, 135)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Aggregate", ColorKey.createColorKey("Pink", Color(255, 122, 189)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Type", ColorKey.createColorKey("Blue", Color(130, 182, 255)), ColorDescriptor.Kind.FOREGROUND),
- ColorDescriptor("Annotation", ColorKey.createColorKey("Orange", Color(255, 161, 135)), ColorDescriptor.Kind.FOREGROUND),
- //ColorDescriptor("Bad Value", ColorKey.createColorKey("Line Comment", Color(10, 10, 10)), ColorDescriptor.Kind.FOREGROUND),
+ private fun formatAttributeKeyName(name: String): String {
+ return name
+ .split("_")
+ .joinToString(" ") { val lower = it.lowercase(); lower.replaceFirstChar(Char::uppercaseChar) }
+ }
+
+ private fun getAttributesDescriptor(key: TextAttributesKey, keyName: String): AttributesDescriptor {
+ return AttributesDescriptor(formatAttributeKeyName(keyName), key)
+ }
+
+ private var ATTR_DESC = arrayOf(
+ getAttributesDescriptor(STORAGE_TYPE, ::STORAGE_TYPE.name),
+ getAttributesDescriptor(STORAGE_MODIFIER, ::STORAGE_MODIFIER.name),
+ getAttributesDescriptor(KEYWORD, ::KEYWORD.name),
+ getAttributesDescriptor(OPERATOR, ::OPERATOR.name),
+ getAttributesDescriptor(ANNOTATION, ::ANNOTATION.name),
+ getAttributesDescriptor(FUNCTION, ::FUNCTION.name),
+ getAttributesDescriptor(BOOLEAN, ::BOOLEAN.name),
+ getAttributesDescriptor(STRING, ::STRING.name),
+ getAttributesDescriptor(NUMERIC, ::NUMERIC.name),
+ getAttributesDescriptor(DATE, ::DATE.name),
+ getAttributesDescriptor(VARIABLE, ::VARIABLE.name),
+ getAttributesDescriptor(LABEL, ::LABEL.name),
+ getAttributesDescriptor(IID, ::IID.name),
+ getAttributesDescriptor(LINE_COMMENT, ::LINE_COMMENT.name),
)
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLSyntaxHighlighter.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLSyntaxHighlighter.kt
index f54b3b9..290f5d1 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLSyntaxHighlighter.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLSyntaxHighlighter.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.highlighter
import com.intellij.lexer.Lexer
@@ -7,11 +28,11 @@ import com.intellij.openapi.editor.colors.TextAttributesKey
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase
import com.intellij.psi.TokenType
import com.intellij.psi.tree.IElementType
-import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
-import org.typedb.typeql.plugin.jetbrains.TypeQLLexer
+import com.vaticle.typeql.grammar.TypeQLLexer
import org.antlr.intellij.adaptor.lexer.ANTLRLexerAdaptor
import org.antlr.intellij.adaptor.lexer.PSIElementTypeFactory
import org.antlr.intellij.adaptor.lexer.TokenIElementType
+import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
@@ -25,72 +46,218 @@ class TypeQLSyntaxHighlighter : SyntaxHighlighterBase() {
override fun getTokenHighlights(tokenType: IElementType): Array {
if (tokenType !is TokenIElementType) return EMPTY_KEYS
if (tokenType == TokenType.BAD_CHARACTER) return arrayOf(BAD_CHARACTER)
- val type = tokenType.antlrTokenType
- val attrKey: TextAttributesKey
- attrKey = when (type) {
- TypeQLLexer.IID_, TypeQLLexer.LABEL_, TypeQLLexer.LABEL_SCOPED_ -> ID
-
- TypeQLLexer.THING, TypeQLLexer.ENTITY, TypeQLLexer.ATTRIBUTE, TypeQLLexer.RELATION, TypeQLLexer.ROLE
- -> THING
-
- TypeQLLexer.DEFINE, TypeQLLexer.UNDEFINE, TypeQLLexer.MATCH, TypeQLLexer.GET, TypeQLLexer.INSERT,
- TypeQLLexer.DELETE, TypeQLLexer.COMPUTE, TypeQLLexer.OFFSET, TypeQLLexer.LIMIT,
- TypeQLLexer.SORT, TypeQLLexer.ASC, TypeQLLexer.DESC, TypeQLLexer.ABSTRACT, TypeQLLexer.AS,
- TypeQLLexer.TYPE, TypeQLLexer.ISA_, TypeQLLexer.SUB_,
- TypeQLLexer.OWNS, TypeQLLexer.PLAYS, TypeQLLexer.RELATES, TypeQLLexer.VALUE, TypeQLLexer.REGEX,
- TypeQLLexer.WHEN, TypeQLLexer.THEN, TypeQLLexer.HAS, TypeQLLexer.PAREN_OPEN,
- TypeQLLexer.PAREN_CLOSE, TypeQLLexer.UNRECOGNISED, TypeQLLexer.NOT, TypeQLLexer.RULE,
- TypeQLLexer.OR, TypeQLLexer.EQ, TypeQLLexer.NEQ, TypeQLLexer.GT, TypeQLLexer.GTE, TypeQLLexer.LT,
- TypeQLLexer.LTE, TypeQLLexer.LIKE, TypeQLLexer.CONTAINS, TypeQLLexer.ASSIGN, TypeQLLexer.ADD,
- TypeQLLexer.SUBTRACT, TypeQLLexer.DIVIDE, TypeQLLexer.MULTIPLY, TypeQLLexer.POWER, TypeQLLexer.MODULO,
- TypeQLLexer.LABEL_SCOPED_, TypeQLLexer.ORDER_
+
+ val attrKey: TextAttributesKey = when (tokenType.antlrTokenType) {
+ TypeQLLexer.THING,
+ TypeQLLexer.ENTITY,
+ TypeQLLexer.ATTRIBUTE,
+ TypeQLLexer.RELATION,
+ TypeQLLexer.ROLE,
+ -> STORAGE_TYPE
+
+ TypeQLLexer.LONG,
+ TypeQLLexer.DOUBLE,
+ TypeQLLexer.STRING,
+ TypeQLLexer.BOOLEAN,
+ TypeQLLexer.DATETIME,
+ -> STORAGE_MODIFIER
+
+ TypeQLLexer.MATCH,
+ TypeQLLexer.GET,
+ TypeQLLexer.DEFINE,
+ TypeQLLexer.UNDEFINE,
+ TypeQLLexer.RULE,
+ TypeQLLexer.INSERT,
+ TypeQLLexer.DELETE,
+ TypeQLLexer.COMPUTE,
+
+ TypeQLLexer.TYPE,
+ TypeQLLexer.ABSTRACT,
+ TypeQLLexer.SUB_,
+ TypeQLLexer.SUB,
+ TypeQLLexer.SUBX,
+ TypeQLLexer.OWNS,
+ TypeQLLexer.REGEX,
+ TypeQLLexer.AS,
+ TypeQLLexer.PLAYS,
+ TypeQLLexer.RELATES,
+ TypeQLLexer.WHEN,
+ TypeQLLexer.THEN,
+ TypeQLLexer.IID,
+ TypeQLLexer.ISA_,
+ TypeQLLexer.ISA,
+ TypeQLLexer.ISAX,
+ TypeQLLexer.HAS,
+ TypeQLLexer.VALUE,
+ TypeQLLexer.IS,
+
+ TypeQLLexer.OFFSET,
+ TypeQLLexer.LIMIT,
+ TypeQLLexer.SORT,
+ TypeQLLexer.ORDER_,
+ TypeQLLexer.ASC,
+ TypeQLLexer.DESC,
+
+ TypeQLLexer.UNRECOGNISED,
-> KEYWORD
- TypeQLLexer.ANNOTATION_KEY, TypeQLLexer.ANNOTATION_UNIQUE -> ANNOTATION
+ TypeQLLexer.PAREN_OPEN,
+ TypeQLLexer.PAREN_CLOSE,
+ TypeQLLexer.ASSIGN,
+ TypeQLLexer.ADD,
+ TypeQLLexer.SUBTRACT,
+ TypeQLLexer.DIVIDE,
+ TypeQLLexer.MULTIPLY,
+ TypeQLLexer.POWER,
+ TypeQLLexer.MODULO,
+
+ TypeQLLexer.OR,
+ TypeQLLexer.NOT,
+ TypeQLLexer.EQ,
+ TypeQLLexer.NEQ,
+ TypeQLLexer.GT,
+ TypeQLLexer.GTE,
+ TypeQLLexer.LT,
+ TypeQLLexer.LTE,
+ TypeQLLexer.LIKE,
+ TypeQLLexer.CONTAINS,
+ -> OPERATOR
+
+ TypeQLLexer.ANNOTATION_KEY,
+ TypeQLLexer.ANNOTATION_UNIQUE,
+ -> ANNOTATION
- TypeQLLexer.COUNT, TypeQLLexer.MAX, TypeQLLexer.MIN, TypeQLLexer.MEAN, TypeQLLexer.MEDIAN, TypeQLLexer.STD,
- TypeQLLexer.SUM, TypeQLLexer.GROUP
- -> AGGREGATE
+ TypeQLLexer.GROUP,
+ TypeQLLexer.COUNT,
+ TypeQLLexer.MAX,
+ TypeQLLexer.MIN,
+ TypeQLLexer.MEAN,
+ TypeQLLexer.MEDIAN,
+ TypeQLLexer.STD,
+ TypeQLLexer.SUM,
+ -> FUNCTION
- TypeQLLexer.LONG, TypeQLLexer.DOUBLE, TypeQLLexer.STRING, TypeQLLexer.BOOLEAN, TypeQLLexer.DATETIME
- -> TYPE
+ TypeQLLexer.BOOLEAN_,
+ TypeQLLexer.TRUE,
+ TypeQLLexer.FALSE,
+ -> BOOLEAN
- TypeQLLexer.COMMENT -> LINE_COMMENT
+ TypeQLLexer.QUOTED_STRING,
+ -> STRING
- TypeQLLexer.LONG_, TypeQLLexer.DOUBLE_, TypeQLLexer.DATE_, TypeQLLexer.DATETIME_
- -> NUMBER
+ TypeQLLexer.LONG_,
+ TypeQLLexer.DOUBLE_,
+ -> NUMERIC
- TypeQLLexer.BOOLEAN_ -> BOOLEAN
+ TypeQLLexer.DATE_,
+ TypeQLLexer.DATETIME_,
+ -> DATE
- TypeQLLexer.STRING_ -> STRING
+ TypeQLLexer.VAR_CONCEPT_,
+ TypeQLLexer.VAR_CONCEPT_ANONYMOUS_,
+ TypeQLLexer.VAR_CONCEPT_NAMED_,
+ TypeQLLexer.VAR_VALUE_,
+ -> VARIABLE
- TypeQLLexer.VAR_CONCEPT_, TypeQLLexer.VAR_CONCEPT_ANONYMOUS_, TypeQLLexer.VAR_CONCEPT_NAMED_,
- TypeQLLexer.VAR_VALUE_
- -> VAR
- else -> return EMPTY_KEYS
+ TypeQLLexer.LABEL_,
+ TypeQLLexer.LABEL_SCOPED_,
+ -> LABEL
+
+ TypeQLLexer.IID_,
+ -> IID
+
+ TypeQLLexer.COMMENT,
+ -> LINE_COMMENT
+
+ else
+ -> return EMPTY_KEYS
}
+
return arrayOf(attrKey)
}
companion object {
private val EMPTY_KEYS = emptyArray()
- val LINE_COMMENT =
- TextAttributesKey.createTextAttributesKey("TYPEQL_LINE_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT)
- val KEYWORD = TextAttributesKey.createTextAttributesKey("TYPEQL_KEYWORD", DefaultLanguageHighlighterColors.KEYWORD)
- val ANNOTATION = TextAttributesKey.createTextAttributesKey("TYPEQL_ANNOTATION")
- val STRING = TextAttributesKey.createTextAttributesKey("TYPEQL_STRING", DefaultLanguageHighlighterColors.STRING)
- val NUMBER = TextAttributesKey.createTextAttributesKey("TYPEQL_NUMBER", DefaultLanguageHighlighterColors.NUMBER)
- val ID = TextAttributesKey.createTextAttributesKey("TYPEQL_IDENTIFIER", DefaultLanguageHighlighterColors.CONSTANT)
- val THING = TextAttributesKey.createTextAttributesKey("TYPEQL_THING", DefaultLanguageHighlighterColors.IDENTIFIER)
- val VAR = TextAttributesKey.createTextAttributesKey("TYPEQL_VAR", DefaultLanguageHighlighterColors.LOCAL_VARIABLE)
- val BOOLEAN = TextAttributesKey.createTextAttributesKey("TYPEQL_BOOLEAN", DefaultLanguageHighlighterColors.PARAMETER)
- val AGGREGATE = TextAttributesKey.createTextAttributesKey("TYPEQL_AGGREGATE", DefaultLanguageHighlighterColors.LABEL)
- val BAD_CHARACTER = TextAttributesKey.createTextAttributesKey("TYPEQL_SIMPLE_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER)
- val TYPE = TextAttributesKey.createTextAttributesKey("TYPEQL_TYPE", DefaultLanguageHighlighterColors.MARKUP_TAG)
+
+ val STORAGE_TYPE = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_STORAGE_TYPE",
+ DefaultLanguageHighlighterColors.INSTANCE_FIELD
+ )
+
+ val STORAGE_MODIFIER = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_STORAGE_MODIFIER",
+ DefaultLanguageHighlighterColors.INSTANCE_METHOD
+ )
+
+ val KEYWORD = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_KEYWORD",
+ DefaultLanguageHighlighterColors.KEYWORD
+ )
+
+ val OPERATOR = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_OPERATOR",
+ DefaultLanguageHighlighterColors.OPERATION_SIGN
+ )
+
+ val ANNOTATION = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_ANNOTATION",
+ DefaultLanguageHighlighterColors.METADATA
+ )
+
+ val FUNCTION = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_FUNCTION",
+ DefaultLanguageHighlighterColors.KEYWORD
+ )
+
+ val BOOLEAN = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_BOOLEAN",
+ DefaultLanguageHighlighterColors.NUMBER
+ )
+
+ val STRING = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_STRING",
+ DefaultLanguageHighlighterColors.STRING
+ )
+
+ val NUMERIC = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_NUMERIC",
+ DefaultLanguageHighlighterColors.NUMBER
+ )
+
+ val DATE = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_DATE",
+ DefaultLanguageHighlighterColors.NUMBER
+ )
+
+ val VARIABLE = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_VARIABLE",
+ DefaultLanguageHighlighterColors.INSTANCE_FIELD
+ )
+
+ val LABEL = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_LABEL",
+ DefaultLanguageHighlighterColors.GLOBAL_VARIABLE
+ )
+
+ val IID = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_IID",
+ DefaultLanguageHighlighterColors.NUMBER
+ )
+
+ val LINE_COMMENT = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_LINE_COMMENT",
+ DefaultLanguageHighlighterColors.DOC_COMMENT
+ )
+
+ val BAD_CHARACTER = TextAttributesKey.createTextAttributesKey(
+ "TYPEQL_BAD_CHARACTER",
+ HighlighterColors.BAD_CHARACTER
+ )
+
init {
PSIElementTypeFactory.defineLanguageIElementTypes(
TypeQLLanguage.INSTANCE, TypeQLLexer.tokenNames, TypeQLLexer.ruleNames
)
}
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLSyntaxHighlighterFactory.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLSyntaxHighlighterFactory.kt
index 7ac8433..363217c 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLSyntaxHighlighterFactory.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/highlighter/TypeQLSyntaxHighlighterFactory.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.highlighter
import com.intellij.openapi.fileTypes.SyntaxHighlighter
@@ -12,4 +33,4 @@ class TypeQLSyntaxHighlighterFactory : SyntaxHighlighterFactory() {
override fun getSyntaxHighlighter(project: Project?, virtualFile: VirtualFile?): SyntaxHighlighter {
return TypeQLSyntaxHighlighter()
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/duplicateDeclaration/TypeQLDuplicateDeclarationInspection.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/duplicateDeclaration/TypeQLDuplicateDeclarationInspection.kt
index 4665588..ba1bf4a 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/duplicateDeclaration/TypeQLDuplicateDeclarationInspection.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/duplicateDeclaration/TypeQLDuplicateDeclarationInspection.kt
@@ -1,67 +1,68 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.duplicateDeclaration
-
-import com.intellij.codeInspection.LocalInspectionTool
-import com.intellij.codeInspection.ProblemHighlightType
-import com.intellij.codeInspection.ProblemsHolder
-import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiElementVisitor
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiRelatesTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiTypeConstraint
-import java.util.stream.Collectors
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLDuplicateDeclarationInspection : LocalInspectionTool() {
- override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
- return object : PsiElementVisitor() {
- override fun visitElement(identifier: PsiElement) {
- if (identifier is PsiTypeQLNamedElement) {
- TypeQLPsiUtils.ensureTypeQLElementsUpToDate(identifier.getContainingFile())
- val declarationTypes = TypeQLPsiUtils.findDeclarations(
- identifier.getProject(), identifier
- ).stream()
- .map {
- if (it is PsiRelatesTypeConstraint) "relation" else TypeQLPsiUtils.determineDeclarationType(
- it
- )
- }
- .distinct().collect(Collectors.toList())
- if (declarationTypes.size > 1) {
- if (identifier is PsiTypeConstraint) {
- holder.registerProblem(
- identifier.getFirstChild(),
- "Concept #ref
has been defined more than once",
- ProblemHighlightType.GENERIC_ERROR
- )
- } else {
- holder.registerProblem(
- identifier.getFirstChild().nextSibling.nextSibling,
- "Concept #ref
has been defined more than once",
- ProblemHighlightType.GENERIC_ERROR
- )
- }
- }
- }
- }
- }
- }
-
- override fun getDisplayName(): String {
- return "Duplicate declaration"
- }
-
- override fun getGroupDisplayName(): String {
- return "TypeQL"
- }
-
- override fun getShortName(): String {
- return "DuplicateDeclaration"
- }
-
- override fun isEnabledByDefault(): Boolean {
- return true
- }
-}
\ No newline at end of file
+//package org.typedb.typeql.plugin.jetbrains.inspection.duplicateDeclaration
+//
+//import com.intellij.codeInspection.LocalInspectionTool
+//import com.intellij.codeInspection.ProblemHighlightType
+//import com.intellij.codeInspection.ProblemsHolder
+//import com.intellij.psi.PsiElement
+//import com.intellij.psi.PsiElementVisitor
+//import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+//import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
+//import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
+//import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiRelatesTypeConstraint
+//import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiTypeConstraint
+//import java.util.stream.Collectors
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLDuplicateDeclarationInspection : LocalInspectionTool() {
+// override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
+// return object : PsiElementVisitor() {
+// override fun visitElement(identifier: PsiElement) {
+// if (identifier is PsiTypeQLNamedElement) {
+// TypeQLPsiUtils.ensureTypeQLElementsUpToDate(identifier.getContainingFile())
+// val declarationTypes = TypeQLDeclarationFinder.findDeclarations(
+// identifier.getProject(), identifier
+// ).stream()
+// .map {
+// if (it is PsiRelatesTypeConstraint) "relation" else TypeQLPsiUtils.determineDeclarationType(
+// it
+// )
+// }
+// .distinct().collect(Collectors.toList())
+// if (declarationTypes.size > 1) {
+// if (identifier is PsiTypeConstraint) {
+// holder.registerProblem(
+// identifier.getFirstChild(),
+// "Concept #ref
has been defined more than once",
+// ProblemHighlightType.GENERIC_ERROR
+// )
+// } else {
+// holder.registerProblem(
+// identifier.getFirstChild().nextSibling.nextSibling,
+// "Concept #ref
has been defined more than once",
+// ProblemHighlightType.GENERIC_ERROR
+// )
+// }
+// }
+// }
+// }
+// }
+// }
+//
+// override fun getDisplayName(): String {
+// return "Duplicate declaration"
+// }
+//
+// override fun getGroupDisplayName(): String {
+// return TypeQLFileType.LANG_NAME
+// }
+//
+// override fun getShortName(): String {
+// return "DuplicateDeclaration"
+// }
+//
+// override fun isEnabledByDefault(): Boolean {
+// return true
+// }
+//}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/duplicateDeclaration/TypeQLDuplicateDeclarationProvider.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/duplicateDeclaration/TypeQLDuplicateDeclarationProvider.kt
index 20c3f13..70f8a43 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/duplicateDeclaration/TypeQLDuplicateDeclarationProvider.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/duplicateDeclaration/TypeQLDuplicateDeclarationProvider.kt
@@ -1,13 +1,13 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.duplicateDeclaration
-
-import com.intellij.codeInspection.InspectionToolProvider
-import com.intellij.codeInspection.LocalInspectionTool
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLDuplicateDeclarationProvider : InspectionToolProvider {
- override fun getInspectionClasses(): Array> {
- return arrayOf(TypeQLDuplicateDeclarationInspection::class.java)
- }
-}
+//package org.typedb.typeql.plugin.jetbrains.inspection.duplicateDeclaration
+//
+//import com.intellij.codeInspection.InspectionToolProvider
+//import com.intellij.codeInspection.LocalInspectionTool
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLDuplicateDeclarationProvider : InspectionToolProvider {
+// override fun getInspectionClasses(): Array> {
+// return arrayOf(TypeQLDuplicateDeclarationInspection::class.java)
+// }
+//}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/invalidTypeUsage/TypeQLInvalidTypeUsageInspection.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/invalidTypeUsage/TypeQLInvalidTypeUsageInspection.kt
index e9fe6f6..38edb66 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/invalidTypeUsage/TypeQLInvalidTypeUsageInspection.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/invalidTypeUsage/TypeQLInvalidTypeUsageInspection.kt
@@ -1,85 +1,85 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.invalidTypeUsage
-
-import com.google.common.collect.Sets
-import com.intellij.codeInspection.LocalInspectionTool
-import com.intellij.codeInspection.ProblemHighlightType
-import com.intellij.codeInspection.ProblemsHolder
-import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiElementVisitor
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiOwnsTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiPlaysTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiSubTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
-import org.apache.commons.lang.StringUtils
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLInvalidTypeUsageInspection : LocalInspectionTool() {
- private val invalidTypeUsages: MutableMap>
-
- init {
- invalidTypeUsages = HashMap()
- invalidTypeUsages["entity"] = Sets.newHashSet("relates", "plays", "owns")
- invalidTypeUsages["role"] = Sets.newHashSet("owns")
- invalidTypeUsages["attribute"] = Sets.newHashSet("plays")
- invalidTypeUsages["relation"] = Sets.newHashSet("plays", "owns")
- }
-
- override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
- return object : PsiElementVisitor() {
- override fun visitElement(identifier: PsiElement) {
- if (identifier is PsiTypeQLElement
- && identifier !is PsiTypeQLNamedElement
- && identifier !is PsiStatementType
- ) {
- TypeQLPsiUtils.ensureTypeQLElementsUpToDate(identifier.getContainingFile())
- val declaration = TypeQLPsiUtils.findDeclaration(
- identifier.getProject(), identifier
- )
- if (declaration != null) {
- val declarationType = TypeQLPsiUtils.determineDeclarationType(declaration)
- val usageType: String
- usageType = if (identifier is PsiPlaysTypeConstraint) {
- "plays"
- } else if (identifier is PsiOwnsTypeConstraint) {
- "owns"
- } else if (identifier is PsiSubTypeConstraint) {
- return //all types can be sub-typed
- } else {
- throw UnsupportedOperationException()
- }
- if (declarationType != null && invalidTypeUsages[declarationType]!!.contains(usageType)) {
- holder.registerProblem(
- identifier.getFirstChild().nextSibling.nextSibling, String.format(
- "%s #ref
cannot be used as '%s'",
- StringUtils.capitalize(declarationType), usageType
- ),
- ProblemHighlightType.GENERIC_ERROR
- )
- }
- }
- }
- }
- }
- }
-
- override fun getDisplayName(): String {
- return "Invalid type usage"
- }
-
- override fun getGroupDisplayName(): String {
- return "TypeQL"
- }
-
- override fun getShortName(): String {
- return "InvalidTypeUsage"
- }
-
- override fun isEnabledByDefault(): Boolean {
- return true
- }
-}
\ No newline at end of file
+//package org.typedb.typeql.plugin.jetbrains.inspection.invalidTypeUsage
+//
+//import com.google.common.collect.Sets
+//import com.intellij.codeInspection.LocalInspectionTool
+//import com.intellij.codeInspection.ProblemHighlightType
+//import com.intellij.codeInspection.ProblemsHolder
+//import com.intellij.psi.PsiElement
+//import com.intellij.psi.PsiElementVisitor
+//import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
+//import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
+//import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
+//import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiOwnsTypeConstraint
+//import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiPlaysTypeConstraint
+//import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiSubTypeConstraint
+//import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
+//import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLInvalidTypeUsageInspection : LocalInspectionTool() {
+// private val invalidTypeUsages: MutableMap>
+//
+// init {
+// invalidTypeUsages = HashMap()
+// invalidTypeUsages["entity"] = Sets.newHashSet("relates", "plays", "owns")
+// invalidTypeUsages["role"] = Sets.newHashSet("owns")
+// invalidTypeUsages["attribute"] = Sets.newHashSet("plays")
+// invalidTypeUsages["relation"] = Sets.newHashSet("plays", "owns")
+// }
+//
+// override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
+// return object : PsiElementVisitor() {
+// override fun visitElement(identifier: PsiElement) {
+// if (identifier is PsiTypeQLElement
+// && identifier !is PsiTypeQLNamedElement
+// && identifier !is PsiStatementType
+// ) {
+// TypeQLPsiUtils.ensureTypeQLElementsUpToDate(identifier.getContainingFile())
+// val declaration = TypeQLDeclarationFinder.findDeclaration(
+// identifier.getProject(), identifier
+// )
+// if (declaration != null) {
+// val declarationType = TypeQLPsiUtils.determineDeclarationType(declaration)
+// val usageType: String
+// usageType = if (identifier is PsiPlaysTypeConstraint) {
+// "plays"
+// } else if (identifier is PsiOwnsTypeConstraint) {
+// "owns"
+// } else if (identifier is PsiSubTypeConstraint) {
+// return //all types can be sub-typed
+// } else {
+// throw UnsupportedOperationException()
+// }
+// if (declarationType != null && invalidTypeUsages[declarationType]!!.contains(usageType)) {
+// holder.registerProblem(
+// identifier.getFirstChild().nextSibling.nextSibling, String.format(
+// "%s #ref
cannot be used as '%s'",
+// declarationType.capitalize(), usageType
+// ),
+// ProblemHighlightType.GENERIC_ERROR
+// )
+// }
+// }
+// }
+// }
+// }
+// }
+//
+// override fun getDisplayName(): String {
+// return "Invalid type usage"
+// }
+//
+// override fun getGroupDisplayName(): String {
+// return TypeQLFileType.LANG_NAME
+// }
+//
+// override fun getShortName(): String {
+// return "InvalidTypeUsage"
+// }
+//
+// override fun isEnabledByDefault(): Boolean {
+// return true
+// }
+//}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/invalidTypeUsage/TypeQLInvalidTypeUsageProvider.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/invalidTypeUsage/TypeQLInvalidTypeUsageProvider.kt
index ace2f49..469aeda 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/invalidTypeUsage/TypeQLInvalidTypeUsageProvider.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/invalidTypeUsage/TypeQLInvalidTypeUsageProvider.kt
@@ -1,13 +1,13 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.invalidTypeUsage
-
-import com.intellij.codeInspection.InspectionToolProvider
-import com.intellij.codeInspection.LocalInspectionTool
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLInvalidTypeUsageProvider : InspectionToolProvider {
- override fun getInspectionClasses(): Array> {
- return arrayOf(TypeQLInvalidTypeUsageInspection::class.java)
- }
-}
+//package org.typedb.typeql.plugin.jetbrains.inspection.invalidTypeUsage
+//
+//import com.intellij.codeInspection.InspectionToolProvider
+//import com.intellij.codeInspection.LocalInspectionTool
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLInvalidTypeUsageProvider : InspectionToolProvider {
+// override fun getInspectionClasses(): Array> {
+// return arrayOf(TypeQLInvalidTypeUsageInspection::class.java)
+// }
+//}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/undefinedDeclaration/TypeQLUndefinedDeclarationInspection.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/undefinedDeclaration/TypeQLUndefinedDeclarationInspection.kt
index 14ce27d..b71dfb2 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/undefinedDeclaration/TypeQLUndefinedDeclarationInspection.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/undefinedDeclaration/TypeQLUndefinedDeclarationInspection.kt
@@ -1,75 +1,75 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.undefinedDeclaration
-
-import com.intellij.codeInspection.LocalInspectionTool
-import com.intellij.codeInspection.ProblemHighlightType
-import com.intellij.codeInspection.ProblemsHolder
-import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiElementVisitor
-import com.intellij.psi.PsiErrorElement
-import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
-import org.apache.commons.lang.StringUtils
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLUndefinedDeclarationInspection : LocalInspectionTool() {
- override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
- return object : PsiElementVisitor() {
- override fun visitElement(element: PsiElement) {
- if (element is PsiStatementType) {
- TypeQLPsiUtils.ensureTypeQLElementsUpToDate(element.getContainingFile())
- val identifiers: MutableList = ArrayList()
- identifiers.addAll(element.findOwnsTypeProperties())
- identifiers.addAll(element.findPlaysTypeProperties())
- identifiers.addAll(element.findSubTypeProperties())
- for (identifier in identifiers) {
- if (StringUtils.isEmpty(identifier!!.name)) {
- return //user still typing
- }
- val declaration = TypeQLPsiUtils.findDeclaration(
- identifier.project, identifier
- )
- if (declaration == null) {
- var undefinedConcept: PsiElement
- undefinedConcept =
- if (identifier.firstChild != null && identifier.firstChild.nextSibling != null && identifier.firstChild.nextSibling.nextSibling != null) {
- identifier.firstChild.nextSibling.nextSibling
- } else {
- return //user still typing
- }
- if (TypeQLLanguage.GRAQL_TYPES.contains(undefinedConcept.text)) {
- return //defined by language
- }
- if (undefinedConcept.firstChild !is PsiErrorElement) {
- holder.registerProblem(
- undefinedConcept,
- "Concept #ref
has not been defined",
- ProblemHighlightType.GENERIC_ERROR
- )
- }
- }
- }
- }
- }
- }
- }
-
- override fun getDisplayName(): String {
- return "Undefined declaration"
- }
-
- override fun getGroupDisplayName(): String {
- return "TypeQL"
- }
-
- override fun getShortName(): String {
- return "UndefinedDeclaration"
- }
-
- override fun isEnabledByDefault(): Boolean {
- return true
- }
-}
\ No newline at end of file
+//package org.typedb.typeql.plugin.jetbrains.inspection.undefinedDeclaration
+//
+//import com.intellij.codeInspection.LocalInspectionTool
+//import com.intellij.codeInspection.ProblemHighlightType
+//import com.intellij.codeInspection.ProblemsHolder
+//import com.intellij.psi.PsiElement
+//import com.intellij.psi.PsiElementVisitor
+//import com.intellij.psi.PsiErrorElement
+//import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
+//import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
+//import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
+//import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
+//import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLUndefinedDeclarationInspection : LocalInspectionTool() {
+// override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
+// return object : PsiElementVisitor() {
+// override fun visitElement(element: PsiElement) {
+// if (element is PsiStatementType) {
+// TypeQLPsiUtils.ensureTypeQLElementsUpToDate(element.getContainingFile())
+// val identifiers: MutableList = ArrayList()
+// identifiers.addAll(element.findOwnsTypeProperties())
+// identifiers.addAll(element.findPlaysTypeProperties())
+// identifiers.addAll(element.findSubTypeProperties())
+// for (identifier in identifiers) {
+// if (identifier!!.name.isEmpty()) {
+// return //user still typing
+// }
+// val declaration = TypeQLDeclarationFinder.findDeclaration(
+// identifier.project, identifier
+// )
+// if (declaration == null) {
+// var undefinedConcept: PsiElement
+// undefinedConcept =
+// if (identifier.firstChild != null && identifier.firstChild.nextSibling != null && identifier.firstChild.nextSibling.nextSibling != null) {
+// identifier.firstChild.nextSibling.nextSibling
+// } else {
+// return //user still typing
+// }
+// if (TypeQLLanguage.TYPEQL_TYPES.contains(undefinedConcept.text)) {
+// return //defined by language
+// }
+// if (undefinedConcept.firstChild !is PsiErrorElement) {
+// holder.registerProblem(
+// undefinedConcept,
+// "Concept #ref
has not been defined",
+// ProblemHighlightType.GENERIC_ERROR
+// )
+// }
+// }
+// }
+// }
+// }
+// }
+// }
+//
+// override fun getDisplayName(): String {
+// return "Undefined declaration"
+// }
+//
+// override fun getGroupDisplayName(): String {
+// return TypeQLFileType.LANG_NAME
+// }
+//
+// override fun getShortName(): String {
+// return "UndefinedDeclaration"
+// }
+//
+// override fun isEnabledByDefault(): Boolean {
+// return true
+// }
+//}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/undefinedDeclaration/TypeQLUndefinedDeclarationProvider.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/undefinedDeclaration/TypeQLUndefinedDeclarationProvider.kt
index ebb1234..91ed93e 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/undefinedDeclaration/TypeQLUndefinedDeclarationProvider.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/undefinedDeclaration/TypeQLUndefinedDeclarationProvider.kt
@@ -1,13 +1,13 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.undefinedDeclaration
-
-import com.intellij.codeInspection.InspectionToolProvider
-import com.intellij.codeInspection.LocalInspectionTool
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLUndefinedDeclarationProvider : InspectionToolProvider {
- override fun getInspectionClasses(): Array> {
- return arrayOf(TypeQLUndefinedDeclarationInspection::class.java)
- }
-}
+//package org.typedb.typeql.plugin.jetbrains.inspection.undefinedDeclaration
+//
+//import com.intellij.codeInspection.InspectionToolProvider
+//import com.intellij.codeInspection.LocalInspectionTool
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLUndefinedDeclarationProvider : InspectionToolProvider {
+// override fun getInspectionClasses(): Array> {
+// return arrayOf(TypeQLUndefinedDeclarationInspection::class.java)
+// }
+//}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unplayedRole/TypeQLUnplayedRoleInspection.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unplayedRole/TypeQLUnplayedRoleInspection.kt
index 657dc90..f920454 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unplayedRole/TypeQLUnplayedRoleInspection.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unplayedRole/TypeQLUnplayedRoleInspection.kt
@@ -1,84 +1,85 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.unplayedRole
-
-import com.intellij.codeInspection.LocalInspectionTool
-import com.intellij.codeInspection.ProblemsHolder
-import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiElementVisitor
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiPlaysTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLUnplayedRoleInspection : LocalInspectionTool() {
- override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
- return object : PsiElementVisitor() {
- override fun visitElement(identifier: PsiElement) {
- if (identifier is PsiTypeQLElement
- && identifier !is PsiTypeQLNamedElement
- && identifier !is PsiStatementType
- ) {
- TypeQLPsiUtils.ensureTypeQLElementsUpToDate(identifier.getContainingFile())
- val identifierElement = identifier
- val declaration = TypeQLPsiUtils.findDeclaration(
- identifier.getProject(), identifierElement
- )
- if (declaration != null) {
- val type = TypeQLPsiUtils.determineDeclarationType(declaration)
- if ("role" == type) {
- var isPlayed = false
- val usages = TypeQLPsiUtils.findUsages(identifierElement)
- for (usage in usages) {
- if (usage is PsiPlaysTypeConstraint) {
- isPlayed = true
- break
- }
- }
- if (!isPlayed) {
- var problemAlreadyRegistered = false
- for (problem in holder.results) {
- if (problem.psiElement === declaration
- && descriptionTemplate == problem.descriptionTemplate
- ) {
- problemAlreadyRegistered = true
- break
- }
- }
- if (!problemAlreadyRegistered
- && declaration.containingFile.isEquivalentTo(identifier.getContainingFile())
- ) {
- holder.registerProblem(
- declaration.firstChild.nextSibling.nextSibling,
- descriptionTemplate
- )
- }
- }
- }
- }
- }
- }
- }
- }
-
- private val descriptionTemplate: String
- private get() = "Role #ref
is never played"
-
- override fun getDisplayName(): String {
- return "Unplayed role"
- }
-
- override fun getGroupDisplayName(): String {
- return "TypeQL"
- }
-
- override fun getShortName(): String {
- return "UnplayedRole"
- }
-
- override fun isEnabledByDefault(): Boolean {
- return true
- }
-}
\ No newline at end of file
+//package org.typedb.typeql.plugin.jetbrains.inspection.unplayedRole
+//
+//import com.intellij.codeInspection.LocalInspectionTool
+//import com.intellij.codeInspection.ProblemsHolder
+//import com.intellij.psi.PsiElement
+//import com.intellij.psi.PsiElementVisitor
+//import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+//import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
+//import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
+//import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
+//import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiPlaysTypeConstraint
+//import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLUnplayedRoleInspection : LocalInspectionTool() {
+// override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
+// return object : PsiElementVisitor() {
+// override fun visitElement(identifier: PsiElement) {
+// if (identifier is PsiTypeQLElement
+// && identifier !is PsiTypeQLNamedElement
+// && identifier !is PsiStatementType
+// ) {
+// TypeQLPsiUtils.ensureTypeQLElementsUpToDate(identifier.getContainingFile())
+// val identifierElement = identifier
+// val declaration = TypeQLDeclarationFinder.findDeclaration(
+// identifier.getProject(), identifierElement
+// )
+// if (declaration != null) {
+// val type = TypeQLPsiUtils.determineDeclarationType(declaration)
+// if ("role" == type) {
+// var isPlayed = false
+// val usages = TypeQLUsagesFinder.findUsages(identifierElement)
+// for (usage in usages) {
+// if (usage is PsiPlaysTypeConstraint) {
+// isPlayed = true
+// break
+// }
+// }
+// if (!isPlayed) {
+// var problemAlreadyRegistered = false
+// for (problem in holder.results) {
+// if (problem.psiElement === declaration
+// && descriptionTemplate == problem.descriptionTemplate
+// ) {
+// problemAlreadyRegistered = true
+// break
+// }
+// }
+// if (!problemAlreadyRegistered
+// && declaration.containingFile.isEquivalentTo(identifier.getContainingFile())
+// ) {
+// holder.registerProblem(
+// declaration.firstChild.nextSibling.nextSibling,
+// descriptionTemplate
+// )
+// }
+// }
+// }
+// }
+// }
+// }
+// }
+// }
+//
+// private val descriptionTemplate: String
+// private get() = "Role #ref
is never played"
+//
+// override fun getDisplayName(): String {
+// return "Unplayed role"
+// }
+//
+// override fun getGroupDisplayName(): String {
+// return TypeQLFileType.LANG_NAME
+// }
+//
+// override fun getShortName(): String {
+// return "UnplayedRole"
+// }
+//
+// override fun isEnabledByDefault(): Boolean {
+// return true
+// }
+//}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unplayedRole/TypeQLUnplayedRoleProvider.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unplayedRole/TypeQLUnplayedRoleProvider.kt
index 9408b91..7ae736d 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unplayedRole/TypeQLUnplayedRoleProvider.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unplayedRole/TypeQLUnplayedRoleProvider.kt
@@ -1,13 +1,13 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.unplayedRole
-
-import com.intellij.codeInspection.InspectionToolProvider
-import com.intellij.codeInspection.LocalInspectionTool
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLUnplayedRoleProvider : InspectionToolProvider {
- override fun getInspectionClasses(): Array> {
- return arrayOf(TypeQLUnplayedRoleInspection::class.java)
- }
-}
+//package org.typedb.typeql.plugin.jetbrains.inspection.unplayedRole
+//
+//import com.intellij.codeInspection.InspectionToolProvider
+//import com.intellij.codeInspection.LocalInspectionTool
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLUnplayedRoleProvider : InspectionToolProvider {
+// override fun getInspectionClasses(): Array> {
+// return arrayOf(TypeQLUnplayedRoleInspection::class.java)
+// }
+//}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedAttributeDeclarationInspection.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedAttributeDeclarationInspection.kt
index ca5ccc4..17ed3ec 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedAttributeDeclarationInspection.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedAttributeDeclarationInspection.kt
@@ -1,48 +1,49 @@
package org.typedb.typeql.plugin.jetbrains.inspection.unusedDeclaration
-
-import com.intellij.codeInspection.LocalInspectionTool
-import com.intellij.codeInspection.ProblemsHolder
-import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiElementVisitor
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLUnusedAttributeDeclarationInspection : LocalInspectionTool() {
- override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
- return object : PsiElementVisitor() {
- override fun visitElement(element: PsiElement) {
- if (element is PsiStatementType) {
- TypeQLPsiUtils.ensureTypeQLElementsUpToDate(element.getContainingFile())
- for (declaration in element.findTypeProperties()) {
- val type = TypeQLPsiUtils.determineDeclarationType(declaration!!)
- if ("attribute" == type) {
- val usages = TypeQLPsiUtils.findUsages(declaration)
- if (usages.isEmpty()) {
- holder.registerProblem(declaration, "Attribute #ref
is never used")
- }
- }
- }
- }
- }
- }
- }
-
- override fun getDisplayName(): String {
- return "Unused attribute declaration"
- }
-
- override fun getGroupDisplayName(): String {
- return "TypeQL"
- }
-
- override fun getShortName(): String {
- return "UnusedAttributeDeclaration"
- }
-
- override fun isEnabledByDefault(): Boolean {
- return true
- }
-}
\ No newline at end of file
+//
+//import com.intellij.codeInspection.LocalInspectionTool
+//import com.intellij.codeInspection.ProblemsHolder
+//import com.intellij.psi.PsiElement
+//import com.intellij.psi.PsiElementVisitor
+//import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+//import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
+//import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLUnusedAttributeDeclarationInspection : LocalInspectionTool() {
+// override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
+// return object : PsiElementVisitor() {
+// override fun visitElement(element: PsiElement) {
+// if (element is PsiStatementType) {
+// TypeQLPsiUtils.ensureTypeQLElementsUpToDate(element.getContainingFile())
+// for (declaration in element.findTypeProperties()) {
+// val type = TypeQLPsiUtils.determineDeclarationType(declaration!!)
+// if ("attribute" == type) {
+// val usages = TypeQLUsagesFinder.findUsages(declaration)
+// if (usages.isEmpty()) {
+// holder.registerProblem(declaration, "Attribute #ref
is never used")
+// }
+// }
+// }
+// }
+// }
+// }
+// }
+//
+// override fun getDisplayName(): String {
+// return "Unused attribute declaration"
+// }
+//
+// override fun getGroupDisplayName(): String {
+// return TypeQLFileType.LANG_NAME
+// }
+//
+// override fun getShortName(): String {
+// return "UnusedAttributeDeclaration"
+// }
+//
+// override fun isEnabledByDefault(): Boolean {
+// return true
+// }
+//}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedDeclarationProvider.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedDeclarationProvider.kt
index c125ad9..9e77c0b 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedDeclarationProvider.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedDeclarationProvider.kt
@@ -1,16 +1,16 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.unusedDeclaration
-
-import com.intellij.codeInspection.InspectionToolProvider
-import com.intellij.codeInspection.LocalInspectionTool
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLUnusedDeclarationProvider : InspectionToolProvider {
- override fun getInspectionClasses(): Array> {
- return arrayOf(
- TypeQLUnusedAttributeDeclarationInspection::class.java,
- TypeQLUnusedRoleDeclarationInspection::class.java
- )
- }
-}
+//package org.typedb.typeql.plugin.jetbrains.inspection.unusedDeclaration
+//
+//import com.intellij.codeInspection.InspectionToolProvider
+//import com.intellij.codeInspection.LocalInspectionTool
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLUnusedDeclarationProvider : InspectionToolProvider {
+// override fun getInspectionClasses(): Array> {
+// return arrayOf(
+// TypeQLUnusedAttributeDeclarationInspection::class.java,
+// TypeQLUnusedRoleDeclarationInspection::class.java
+// )
+// }
+//}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedRoleDeclarationInspection.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedRoleDeclarationInspection.kt
index 8888311..c3c0d76 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedRoleDeclarationInspection.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/inspection/unusedDeclaration/TypeQLUnusedRoleDeclarationInspection.kt
@@ -1,55 +1,55 @@
-package org.typedb.typeql.plugin.jetbrains.inspection.unusedDeclaration
-
-import com.intellij.codeInspection.LocalInspectionTool
-import com.intellij.codeInspection.ProblemsHolder
-import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiElementVisitor
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
-import org.apache.commons.lang.StringUtils
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class TypeQLUnusedRoleDeclarationInspection : LocalInspectionTool() {
- override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
- return object : PsiElementVisitor() {
- override fun visitElement(element: PsiElement) {
- if (element is PsiStatementType) {
- TypeQLPsiUtils.ensureTypeQLElementsUpToDate(element.getContainingFile())
- for (declaration in element.findRelatesTypeProperties()) {
- if (StringUtils.isEmpty(declaration.name)) {
- return //user still typing
- }
- val type = TypeQLPsiUtils.determineDeclarationType(declaration)
- if ("role" == type) {
- val usages = TypeQLPsiUtils.findUsages(declaration)
- if (usages.isEmpty()) {
- holder.registerProblem(
- declaration.firstChild.nextSibling.nextSibling,
- "Role #ref
is never used"
- )
- }
- }
- }
- }
- }
- }
- }
-
- override fun getDisplayName(): String {
- return "Unused role declaration"
- }
-
- override fun getGroupDisplayName(): String {
- return "TypeQL"
- }
-
- override fun getShortName(): String {
- return "UnusedRoleDeclaration"
- }
-
- override fun isEnabledByDefault(): Boolean {
- return true
- }
-}
+//package org.typedb.typeql.plugin.jetbrains.inspection.unusedDeclaration
+//
+//import com.intellij.codeInspection.LocalInspectionTool
+//import com.intellij.codeInspection.ProblemsHolder
+//import com.intellij.psi.PsiElement
+//import com.intellij.psi.PsiElementVisitor
+//import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
+//import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
+//import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+//
+///**
+// * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+// */
+//class TypeQLUnusedRoleDeclarationInspection : LocalInspectionTool() {
+// override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
+// return object : PsiElementVisitor() {
+// override fun visitElement(element: PsiElement) {
+// if (element is PsiStatementType) {
+// TypeQLPsiUtils.ensureTypeQLElementsUpToDate(element.getContainingFile())
+// for (declaration in element.findRelatesTypeProperties()) {
+// if (declaration.name.isEmpty()) {
+// return //user still typing
+// }
+// val type = TypeQLPsiUtils.determineDeclarationType(declaration)
+// if ("role" == type) {
+// val usages = TypeQLUsagesFinder.findUsages(declaration)
+// if (usages.isEmpty()) {
+// holder.registerProblem(
+// declaration.firstChild.nextSibling.nextSibling,
+// "Role #ref
is never used"
+// )
+// }
+// }
+// }
+// }
+// }
+// }
+// }
+//
+// override fun getDisplayName(): String {
+// return "Unused role declaration"
+// }
+//
+// override fun getGroupDisplayName(): String {
+// return TypeQLFileType.LANG_NAME
+// }
+//
+// override fun getShortName(): String {
+// return "UnusedRoleDeclaration"
+// }
+//
+// override fun isEnabledByDefault(): Boolean {
+// return true
+// }
+//}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLElement.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLElement.kt
index 3620df7..b619c29 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLElement.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLElement.kt
@@ -1,38 +1,47 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.psi
import com.intellij.lang.ASTNode
import com.intellij.psi.impl.source.tree.CompositeElement
-import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiOwnsTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiPlaysTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiRelatesTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiSubTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
import org.antlr.intellij.adaptor.psi.ANTLRPsiNode
+import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
*/
open class PsiTypeQLElement(node: ASTNode) : ANTLRPsiNode(node) {
+ open val labelNode: ASTNode?
+ get() = node
- override fun getNode(): CompositeElement = super.getNode() as CompositeElement
+ open val scopedName: String?
+ get() = name
- override fun getName(): String? {
- return when (this) {
- is PsiSubTypeConstraint -> this.subType
- is PsiPlaysTypeConstraint -> this.playsType
- is PsiOwnsTypeConstraint -> this.ownsType
- else -> super.getName()
- }
- }
+ open val tokenText = ""
- val scopedName: String?
- get() = if (this is PsiRelatesTypeConstraint) {
- val statementType = getParent() as PsiStatementType
- statementType.name + ":" + getName()
- } else {
- name
- }
+ protected val tokenTextOffset
+ get() = tokenText.length - 1 // Minus 2 quotes, plus 1 space
+
+ override fun getNode(): CompositeElement = super.getNode() as CompositeElement
override fun toString(): String = String.format(
"%s(%s) - Location: %s",
@@ -40,7 +49,7 @@ open class PsiTypeQLElement(node: ASTNode) : ANTLRPsiNode(node) {
)
override fun subtreeChanged() {
- val updatedElement = TypeQLParserDefinition.INSTANCE.createElement(super.getNode()) as PsiTypeQLElement
+ val updatedElement = TypeQLParserDefinition.INSTANCE.createElement(super.getNode())
TypeQLParserDefinition.updateWrappedTypeIfNecessary(super.getNode(), updatedElement)
}
}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLElementFactory.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLElementFactory.kt
new file mode 100644
index 0000000..6a376d6
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLElementFactory.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi
+
+import com.intellij.openapi.project.Project
+import com.intellij.psi.PsiFileFactory
+import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+object PsiTypeQLElementFactory {
+ fun createTypeProperty(project: Project?, name: String?): PsiTypeQLNamedElement? {
+ val dummyText = String.format("define\n%s sub entity;", name)
+ val file = createFile(project, dummyText) ?: return null
+
+ // definables -> first definable -> statement -> type node wrapper -> type node
+ val node = PsiTypeQLUtils.getDefinables(file)?.firstChild?.firstChild?.firstChild?.firstChild
+ return if (node != null) node as PsiTypeQLNamedElement else null
+ }
+
+ fun createSubTypeProperty(project: Project?, name: String?): PsiTypeQLReferencingElement? {
+ val dummyText = String.format("define\ndummy sub %s;", name)
+ val file = createFile(project, dummyText) ?: return null
+
+ // definables -> first definable -> statement -> type node wrapper -> whitespace -> subtype node
+ val node = PsiTypeQLUtils.getDefinables(file)?.firstChild?.firstChild?.firstChild?.nextSibling?.nextSibling
+ return if (node != null) node as PsiTypeQLReferencingElement else null
+ }
+
+ fun createRelatesTypeProperty(project: Project?, name: String?): PsiTypeQLNamedElement? {
+ val dummyText = String.format("define\ndummy sub entity, relates %s;", name)
+ val file = createFile(project, dummyText) ?: return null
+
+ // definables -> first definable -> statement -> relates type node
+ val node = PsiTypeQLUtils.getDefinables(file)?.firstChild?.firstChild?.lastChild
+ return if (node != null) node as PsiTypeQLNamedElement else null
+ }
+
+ fun createPlaysTypeProperty(project: Project?, name: String?): PsiTypeQLReferencingElement? {
+ val dummyText = String.format("define\ndummy sub entity, plays %s;", name)
+ val file = createFile(project, dummyText) ?: return null
+
+ // definables -> first definable -> statement -> plays type node
+ val node = PsiTypeQLUtils.getDefinables(file)?.firstChild?.firstChild?.lastChild
+ return if (node != null) node as PsiTypeQLReferencingElement else null
+ }
+
+ fun createOwnsTypeProperty(project: Project?, name: String?): PsiTypeQLReferencingElement? {
+ val dummyText = String.format("define\ndummy sub entity, owns %s;", name)
+ val file = createFile(project, dummyText) ?: return null
+
+ // definables -> first definable -> statement -> owns type node
+ val node = PsiTypeQLUtils.getDefinables(file)?.firstChild?.firstChild?.lastChild
+ return if (node != null) node as PsiTypeQLReferencingElement else null
+ }
+
+ fun createRelatesAsOverrideTypeProperty(project: Project?, name: String?): PsiTypeQLReferencingElement? {
+ val dummyText = String.format("define\ndummy sub entity, relates something as %s;", name)
+ val file = createFile(project, dummyText) ?: return null
+
+ // definables -> first definable -> statement -> relates type node -> relates as override type node
+ val node = PsiTypeQLUtils.getDefinables(file)?.firstChild?.firstChild?.lastChild?.lastChild
+ return if (node != null) node as PsiTypeQLReferencingElement else null
+ }
+
+ fun createPlaysAsOverrideTypeProperty(project: Project?, name: String?): PsiTypeQLReferencingElement? {
+ val dummyText = String.format("define\ndummy sub entity, plays some:role as %s;", name)
+ val file = createFile(project, dummyText) ?: return null
+
+ // definables -> first definable -> statement -> plays type node -> plays as override type node
+ val node = PsiTypeQLUtils.getDefinables(file)?.firstChild?.firstChild?.lastChild?.lastChild
+ return if (node != null) node as PsiTypeQLReferencingElement else null
+ }
+
+ fun createOwnsAsOverrideTypeProperty(project: Project?, name: String?): PsiTypeQLReferencingElement? {
+ val dummyText = String.format("define\ndummy sub entity, owns something as %s;", name)
+ val file = createFile(project, dummyText) ?: return null
+
+ // definables -> first definable -> statement -> owns type node -> annotation -> owns as override type node
+ val node = PsiTypeQLUtils.getDefinables(file)?.firstChild?.firstChild?.lastChild?.lastChild?.prevSibling
+ return if (node != null) node as PsiTypeQLReferencingElement else null
+ }
+
+ fun createFile(project: Project?, text: String): PsiTypeQLFile {
+ return PsiFileFactory.getInstance(project).createFileFromText(
+ "dummy.tql", TypeQLFileType.INSTANCE, text
+ ) as PsiTypeQLFile
+ }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLFile.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLFile.kt
new file mode 100644
index 0000000..46d7dcb
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLFile.kt
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi
+
+import com.intellij.extapi.psi.PsiFileBase
+import com.intellij.openapi.fileTypes.FileType
+import com.intellij.psi.FileViewProvider
+import com.intellij.psi.PsiElement
+import com.intellij.psi.PsiNamedElement
+import org.antlr.intellij.adaptor.psi.ScopeNode
+import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+import org.typedb.typeql.plugin.jetbrains.TypeQLIcons
+import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
+import javax.swing.Icon
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+class PsiTypeQLFile(viewProvider: FileViewProvider) : PsiFileBase(viewProvider, TypeQLLanguage.INSTANCE), ScopeNode {
+ override fun getFileType(): FileType {
+ return TypeQLFileType.INSTANCE
+ }
+
+ override fun toString(): String {
+ return "${TypeQLFileType.LANG_NAME} file"
+ }
+
+ override fun getIcon(flags: Int): Icon {
+ return TypeQLIcons.ICON
+ }
+
+ /**
+ * Return null since a file scope has no enclosing scope. It is
+ * not itself in a scope.
+ */
+ override fun getContext(): ScopeNode? {
+ return null
+ }
+
+ override fun resolve(element: PsiNamedElement): PsiElement? {
+ return null
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLFileBase.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLFileBase.kt
deleted file mode 100644
index 05ef6db..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLFileBase.kt
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi
-
-import com.intellij.extapi.psi.PsiFileBase
-import com.intellij.openapi.fileTypes.FileType
-import com.intellij.openapi.util.IconLoader
-import com.intellij.psi.FileViewProvider
-import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiNamedElement
-import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
-import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
-import org.antlr.intellij.adaptor.psi.ScopeNode
-import javax.swing.Icon
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class PsiTypeQLFileBase(viewProvider: FileViewProvider) : PsiFileBase(viewProvider, TypeQLLanguage.INSTANCE),
- ScopeNode {
- override fun getFileType(): FileType {
- return TypeQLFileType.Util.INSTANCE
- }
-
- override fun toString(): String {
- return "TypeQL Language file"
- }
-
- override fun getIcon(flags: Int): Icon {
- return IconLoader.findIcon("/icons/typedb.svg", PsiTypeQLFileBase::class.java.classLoader)!!
- }
-
- /**
- * Return null since a file scope has no enclosing scope. It is
- * not itself in a scope.
- *
- *
- * todo: a file could be in the scope of all the other files in the project
- */
- override fun getContext(): ScopeNode? {
- return null
- }
-
- override fun resolve(element: PsiNamedElement): PsiElement? {
- return null
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLNamedElement.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLNamedElement.kt
index 2ad915f..1554233 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLNamedElement.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLNamedElement.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.psi
import com.intellij.lang.ASTNode
@@ -7,27 +28,33 @@ import com.intellij.psi.PsiNameIdentifierOwner
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
*/
-abstract class PsiTypeQLNamedElement(node: ASTNode) : PsiTypeQLElement(node), PsiNameIdentifierOwner {
- override fun getTextRange(): TextRange {
- val id = nameIdentifier
- return id?.textRange!!
- }
+/**
+ * Classification between Named and Referencing elements is needed for referencing purposes
+ * (which is a basis for features like "Find Usages", "Find Declaration", "Refactor", etc.).
+ * Named elements are the declarations of entities which can be targets for these features.
+ * This way, they create new "names" for the language.
+ * @ref PsiTypeQLReferencingElement
+ *
+ * Examples:
+ *
+ * "my_new_entity" is a named element, declaring a new entity:
+ * "define my_new_entity sub entity;"
+ *
+ * "my_newest_entity" is a named element, declaring a new entity,
+ * "my_new_entity" is a referencing element, which only relates to the original named element,
+ * but does not create a new name:
+ * "define my_newest_entity sub my_new_entity;"
+ */
+abstract class PsiTypeQLNamedElement(node: ASTNode) : PsiTypeQLElement(node), PsiNameIdentifierOwner {
+ override fun getTextRange(): TextRange? = nameIdentifier?.textRange
- override fun getName(): String? {
- val id = nameIdentifier
- return id?.text
- }
+ override fun getName(): String? = nameIdentifier?.text
- override fun getTextOffset(): Int {
- val id = nameIdentifier
- return id?.textOffset ?: super.getTextOffset()
- }
+ override fun getTextOffset(): Int = nameIdentifier?.textOffset ?: super.getTextOffset()
- override fun toString(): String {
- return String.format(
- "%s(%s) - Name: %s - Location: %s",
- javaClass.simpleName, node.elementType, name, textRange
- )
- }
+ override fun toString(): String = String.format(
+ "%s(%s) - Name: %s - Location: %s",
+ javaClass.simpleName, node.elementType, name, textRange
+ )
}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLReferencingElement.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLReferencingElement.kt
new file mode 100644
index 0000000..778d229
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLReferencingElement.kt
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi
+
+import com.intellij.lang.ASTNode
+import com.intellij.psi.PsiReference
+import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry
+
+/**
+ * Classification between Named and Referencing elements is needed for referencing purposes
+ * (which is a basis for features like "Find Usages", "Find Declaration", "Refactor", etc.).
+ * Referencing elements do not declare new "names" for the language, but only reference already
+ * existing named elements, thus being considered as a "usage" of that entity.
+ * @ref PsiTypeQLNamedElement
+ */
+abstract class PsiTypeQLReferencingElement(node: ASTNode) : PsiTypeQLElement(node) {
+ override fun getName(): String? = labelNode?.text
+
+ override fun getReference(): PsiReference? {
+ val refs = ReferenceProvidersRegistry.getReferencesFromProviders(this)
+ return if (refs.isNotEmpty()) refs[0] else null
+ }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLStatementType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLStatementType.kt
new file mode 100644
index 0000000..577ec36
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLStatementType.kt
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi
+
+import com.intellij.lang.ASTNode
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+class PsiTypeQLStatementType(node: ASTNode) : PsiTypeQLElement(node) {
+
+ override fun getName(): String? = firstChild.text
+
+ val subType: String?
+ get() = node.firstChildNode?.treeNext?.treeNext?.lastChildNode?.text
+
+ // TODO: Uncomment and revalidate while returning the inspection package.
+// fun findRelatesTypeProperties(): List {
+// val relatesTypes: MutableList = ArrayList()
+// for (child in children) {
+// val element = TypeQLParserDefinition.getRuleTypePropertyElement(child.node)
+// if (element is PsiRelatesTypeConstraint) {
+// relatesTypes.add(element)
+// }
+// }
+// return relatesTypes
+// }
+//
+// fun findPlaysTypeProperties(): List {
+// val playsTypes: MutableList = ArrayList()
+// for (child in children) {
+// val element = TypeQLParserDefinition.getRuleTypePropertyElement(child.node)
+// if (element is PsiPlaysTypeConstraint) {
+// playsTypes.add(element)
+// }
+// }
+// return playsTypes
+// }
+//
+// fun findOwnsTypeProperties(): List {
+// val ownsTypes: MutableList = ArrayList()
+// for (child in children) {
+// val element = TypeQLParserDefinition.getRuleTypePropertyElement(child.node)
+// if (element is PsiOwnsTypeConstraint) {
+// ownsTypes.add(element)
+// }
+// }
+// return ownsTypes
+// }
+//
+// fun findSubTypeProperties(): List {
+// val subTypes: MutableList = ArrayList()
+// for (child in children) {
+// val element = TypeQLParserDefinition.getRuleTypePropertyElement(child.node)
+// if (element is PsiSubTypeConstraint) {
+// subTypes.add(element)
+// }
+// }
+// return subTypes
+// }
+//
+// fun findTypeProperties(): List {
+// val relatesTypes: MutableList = ArrayList()
+// for (child in children) {
+// val element = TypeQLParserDefinition.getRuleTypeElement(child.node)
+// if (element is PsiTypeConstraint) {
+// relatesTypes.add(element)
+// }
+// }
+// return relatesTypes
+// }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLUtils.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLUtils.kt
new file mode 100644
index 0000000..5a5fae7
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/PsiTypeQLUtils.kt
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi
+
+import com.intellij.ide.scratch.ScratchUtil
+import com.intellij.openapi.project.Project
+import com.intellij.openapi.vfs.VirtualFile
+import com.intellij.psi.PsiElement
+import com.intellij.psi.PsiFile
+import com.intellij.psi.PsiManager
+import com.intellij.psi.search.FileTypeIndex
+import com.intellij.psi.search.GlobalSearchScope
+import com.intellij.psi.util.PsiTreeUtil
+import org.antlr.intellij.adaptor.lexer.RuleIElementType
+import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
+import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiTypeQLRelatesType
+import org.typedb.typeql.plugin.jetbrains.usage.TypeQLDeclarationFinder
+import java.util.function.Consumer
+import java.util.stream.Collectors
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+object PsiTypeQLUtils {
+ fun getDefinables(file: PsiFile): PsiElement? {
+ return file.firstChild?.firstChild?.firstChild?.firstChild?.lastChild
+ }
+
+ fun ensureTypeQLElementsUpToDate(root: PsiElement?) {
+ try {
+ PsiTreeUtil.collectElementsOfType(root, PsiTypeQLElement::class.java)
+ .forEach(Consumer { obj: PsiTypeQLElement -> obj.subtreeChanged() })
+ } catch (ignored: Throwable) {
+ }
+ }
+
+ fun getDeclarationsByType(
+ project: Project,
+ searchScope: Collection,
+ type: String
+ ): List {
+ return getAllDeclarations(project, searchScope).stream()
+ .filter { it: PsiTypeQLNamedElement -> type == determineDeclarationType(it) }
+ .collect(Collectors.toList())
+ }
+
+ fun getAllDeclarations(
+ project: Project,
+ searchScope: Collection
+ ): List {
+ val declarations: MutableList = ArrayList()
+ for (virtualFile in searchScope) {
+ val typeqlFile = PsiManager.getInstance(project).findFile(virtualFile!!) as PsiTypeQLFile?
+ if (typeqlFile != null) {
+ declarations.addAll(PsiTreeUtil.collectElementsOfType(typeqlFile, PsiTypeQLNamedElement::class.java))
+ }
+ }
+ return declarations
+ }
+
+ fun determineDeclarationType(identifier: PsiTypeQLNamedElement): String? {
+ val subType: String?
+ subType = if (identifier.parent is PsiTypeQLStatementType) {
+ (identifier.parent as PsiTypeQLStatementType).subType
+ } else {
+ (identifier.parent.parent as PsiTypeQLStatementType).subType
+ }
+ if (identifier is PsiTypeQLRelatesType) {
+ return "role"
+ } else if (TypeQLLanguage.TYPEQL_TYPES.contains(subType)) {
+ return subType
+ }
+ val searchScope: Collection
+ searchScope = if (ScratchUtil.isScratch(identifier.containingFile.virtualFile)) {
+ listOf(identifier.containingFile.virtualFile)
+ } else {
+ FileTypeIndex.getFiles(
+ TypeQLFileType.INSTANCE,
+ GlobalSearchScope.allScope(identifier.project)
+ )
+ }
+
+ val declaration = TypeQLDeclarationFinder.findDeclaration(identifier.project, subType, searchScope)
+ return if (declaration == null || declaration === identifier) {
+ null
+ } else {
+ determineDeclarationType(declaration)
+ }
+ }
+
+ fun findParentByType(
+ element: PsiElement,
+ ruleElementType: RuleIElementType
+ ): PsiTypeQLElement? {
+ var parent: PsiElement? = element
+ while (parent?.parent.also { parent = it } != null) {
+ if (parent is PsiTypeQLElement) {
+ val compositeElement = (parent as PsiTypeQLElement).node
+ if (compositeElement.elementType === ruleElementType) {
+ return compositeElement.psi as PsiTypeQLElement
+ }
+ }
+ }
+ return null
+ }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/TypeQLPsiElementFactory.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/TypeQLPsiElementFactory.kt
deleted file mode 100644
index 0888430..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/TypeQLPsiElementFactory.kt
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi
-
-import com.intellij.openapi.project.Project
-import com.intellij.psi.PsiFileFactory
-import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-object TypeQLPsiElementFactory {
- fun createTypeProperty(project: Project?, name: String?): PsiTypeQLNamedElement {
- val dummyText = String.format("define\n%s sub entity;", name)
- val file = createFile(project, dummyText)
- return file.firstChild.firstChild.firstChild.lastChild.firstChild as PsiTypeQLNamedElement
- }
-
- fun createSubTypeProperty(project: Project?, name: String?): PsiTypeQLElement {
- val dummyText = String.format("define\ndummy sub %s;", name)
- val file = createFile(project, dummyText)
- return file.firstChild.firstChild.firstChild.lastChild.firstChild
- .nextSibling.nextSibling as PsiTypeQLElement
- }
-
- fun createRelatesTypeProperty(project: Project?, name: String?): PsiTypeQLNamedElement {
- val dummyText = String.format("define\ndummy sub entity, relates %s;", name)
- val file = createFile(project, dummyText)
- return file.firstChild.firstChild.firstChild.lastChild.firstChild
- .nextSibling.nextSibling.nextSibling.nextSibling.nextSibling as PsiTypeQLNamedElement
- }
-
- fun createPlaysTypeProperty(project: Project?, name: String?): PsiTypeQLElement {
- val dummyText = String.format("define\ndummy sub entity, plays %s;", name)
- val file = createFile(project, dummyText)
- return file.firstChild.firstChild.firstChild.lastChild.firstChild
- .nextSibling.nextSibling.nextSibling.nextSibling.nextSibling as PsiTypeQLElement
- }
-
- fun createFile(project: Project?, text: String?): PsiTypeQLFileBase {
- return PsiFileFactory.getInstance(project).createFileFromText(
- "dummy.tql", TypeQLFileType.Util.INSTANCE, text!!
- ) as PsiTypeQLFileBase
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/TypeQLPsiUtils.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/TypeQLPsiUtils.kt
deleted file mode 100644
index 9201fb2..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/TypeQLPsiUtils.kt
+++ /dev/null
@@ -1,289 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi
-
-import com.intellij.ide.scratch.ScratchUtil
-import com.intellij.openapi.project.Project
-import com.intellij.openapi.vfs.VirtualFile
-import com.intellij.psi.PsiElement
-import com.intellij.psi.PsiFile
-import com.intellij.psi.PsiManager
-import com.intellij.psi.search.FileTypeIndex
-import com.intellij.psi.search.GlobalSearchScope
-import com.intellij.psi.util.PsiTreeUtil
-import org.antlr.intellij.adaptor.lexer.RuleIElementType
-import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
-import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.*
-import org.typedb.typeql.plugin.jetbrains.psi.statement.PsiStatementType
-import java.util.function.Consumer
-import java.util.stream.Collectors
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-object TypeQLPsiUtils {
- fun ensureTypeQLElementsUpToDate(file: PsiFile?) {
- try {
- PsiTreeUtil.collectElementsOfType(file, PsiTypeQLElement::class.java)
- .forEach(Consumer { obj: PsiTypeQLElement -> obj.subtreeChanged() })
- } catch (ignored: Throwable) {
- }
- }
-
- fun getDeclarationsByType(
- project: Project,
- searchScope: Collection,
- type: String
- ): List {
- return getAllDeclarations(project, searchScope).stream()
- .filter { it: PsiTypeQLNamedElement -> type == determineDeclarationType(it) }
- .collect(Collectors.toList())
- }
-
- fun getAllDeclarations(
- project: Project,
- searchScope: Collection
- ): List {
- val declarations: MutableList = ArrayList()
- for (virtualFile in searchScope) {
- val typeqlFile = PsiManager.getInstance(project).findFile(virtualFile!!) as PsiTypeQLFileBase?
- if (typeqlFile != null) {
- declarations.addAll(PsiTreeUtil.collectElementsOfType(typeqlFile, PsiTypeQLNamedElement::class.java))
- }
- }
- return declarations
- }
-
- fun findUsages(identifier: PsiTypeQLElement): List {
- val identifierFile = identifier.node.psi.containingFile.virtualFile
- return if (ScratchUtil.isScratch(identifierFile)) {
- findUsages(
- identifier.project,
- identifier,
- identifier.scopedName,
- listOf(identifierFile)
- )
- } else {
- findUsages(
- identifier.project, identifier, identifier.scopedName,
- FileTypeIndex.getFiles(
- TypeQLFileType.Util.INSTANCE,
- GlobalSearchScope.allScope(identifier.project)
- )
- )
- }
- }
-
- fun findUsages(
- project: Project, element: PsiTypeQLElement,
- name: String?, searchScope: Collection
- ): List {
- //todo: review logic in this method
- val result: MutableList = ArrayList()
- if (name == null) {
- return result
- }
- for (virtualFile in searchScope) {
- val typeqlFile = PsiManager.getInstance(project).findFile(virtualFile!!) as PsiTypeQLFileBase?
- if (typeqlFile != null) {
- if (element is PsiOwnsTypeConstraint) {
- val ownsIdentifiers = PsiTreeUtil.collectElementsOfType(
- typeqlFile, PsiOwnsTypeConstraint::class.java
- )
- for (identifier in ownsIdentifiers) {
- if (name == identifier.ownsType) {
- result.add(identifier)
- }
- }
- } else if (element is PsiSubTypeConstraint) {
- val subTypeIdentifiers = PsiTreeUtil.collectElementsOfType(
- typeqlFile, PsiSubTypeConstraint::class.java
- )
- for (identifier in subTypeIdentifiers) {
- if (name == identifier.subType) {
- result.add(identifier)
- }
- }
- } else if (element is PsiPlaysTypeConstraint
- || element is PsiRelatesSuperRoleTypeConstraint
- ) {
- val playsIdentifiers = PsiTreeUtil.collectElementsOfType(
- typeqlFile, PsiPlaysTypeConstraint::class.java
- )
- for (identifier in playsIdentifiers) {
- if (name == identifier.playsType) {
- result.add(identifier)
- }
- }
- val relatesSuperRoleIdentifiers =
- PsiTreeUtil.collectElementsOfType(typeqlFile, PsiRelatesSuperRoleTypeConstraint::class.java)
- for (identifier in relatesSuperRoleIdentifiers) {
- if (name == identifier.text) {
- result.add(identifier)
- }
- }
- } else {
- val ownsIdentifiers = PsiTreeUtil.collectElementsOfType(
- typeqlFile, PsiOwnsTypeConstraint::class.java
- )
- for (identifier in ownsIdentifiers) {
- if (name == identifier.ownsType) {
- result.add(identifier)
- }
- }
- val subTypeIdentifiers = PsiTreeUtil.collectElementsOfType(
- typeqlFile, PsiSubTypeConstraint::class.java
- )
- for (identifier in subTypeIdentifiers) {
- if (name == identifier.subType) {
- result.add(identifier)
- }
- }
- val playsIdentifiers = PsiTreeUtil.collectElementsOfType(
- typeqlFile, PsiPlaysTypeConstraint::class.java
- )
- for (identifier in playsIdentifiers) {
- if (name == identifier.playsType) {
- result.add(identifier)
- }
- }
- val relatesSuperRoleIdentifiers =
- PsiTreeUtil.collectElementsOfType(typeqlFile, PsiRelatesSuperRoleTypeConstraint::class.java)
- for (identifier in relatesSuperRoleIdentifiers) {
- if (name == identifier.text) {
- result.add(identifier)
- }
- }
- }
- }
- }
- return result
- }
-
- fun findDeclaration(
- project: Project, name: String?,
- searchScope: Collection
- ): PsiTypeQLNamedElement? {
- val declarations = findDeclarations(project, name, searchScope)
- return if (declarations.isEmpty()) {
- null
- } else {
- declarations[0]
- }
- }
-
- fun findDeclaration(project: Project, identifier: PsiTypeQLElement): PsiTypeQLNamedElement? {
- val declarations = findDeclarations(project, identifier)
- return if (declarations.isEmpty()) {
- null
- } else {
- declarations[0]
- }
- }
-
- fun findDeclarations(
- project: Project,
- identifier: PsiTypeQLElement
- ): List {
- val identifierFile = identifier.node.psi.containingFile.virtualFile
- return if (ScratchUtil.isScratch(identifierFile)) {
- findDeclarations(project, identifier.scopedName, listOf(identifierFile))
- } else {
- findDeclarations(
- project, identifier.scopedName, FileTypeIndex.getFiles(
- TypeQLFileType.Util.INSTANCE, GlobalSearchScope.allScope(project)
- )
- )
- }
- }
-
- fun findDeclarations(
- project: Project, name: String?,
- searchScope: Collection
- ): List {
- val declarations: MutableList = ArrayList()
- if (name == null) {
- return declarations
- }
- for (virtualFile in searchScope) {
- val typeqlFile = PsiManager.getInstance(project).findFile(virtualFile!!) as PsiTypeQLFileBase?
- if (typeqlFile != null) {
- val identifiers = PsiTreeUtil.collectElementsOfType(
- typeqlFile, PsiTypeQLNamedElement::class.java
- )
- for (identifier in identifiers) {
- if (name == identifier.scopedName) {
- declarations.add(identifier)
- }
- }
- }
- }
- return declarations
- }
-
- fun determineDeclarationType(identifier: PsiTypeQLNamedElement): String? {
- val subType: String?
- subType = if (identifier.parent is PsiStatementType) {
- (identifier.parent as PsiStatementType).subType
- } else {
- (identifier.parent.parent as PsiStatementType).subType
- }
- if (identifier is PsiRelatesTypeConstraint) {
- return "role"
- } else if (TypeQLLanguage.GRAQL_TYPES.contains(subType)) {
- return subType
- }
- val searchScope: Collection
- searchScope = if (ScratchUtil.isScratch(identifier.containingFile.virtualFile)) {
- listOf(identifier.containingFile.virtualFile)
- } else {
- FileTypeIndex.getFiles(
- TypeQLFileType.Util.INSTANCE,
- GlobalSearchScope.allScope(identifier.project)
- )
- }
- val declaration = findDeclaration(identifier.project, subType, searchScope)
- return if (declaration == null || declaration === identifier) {
- null
- } else {
- determineDeclarationType(declaration)
- }
- }
-
- fun setName(element: PsiTypeQLElement, newName: String): PsiElement {
- if (element is PsiTypeConstraint) {
- val typeProperty = TypeQLPsiElementFactory.createTypeProperty(element.getProject(), newName)
- element.getParent().node.replaceChild(element.getNode(), typeProperty.node)
- } else if (element is PsiSubTypeConstraint) {
- val subTypeProperty = TypeQLPsiElementFactory.createSubTypeProperty(element.getProject(), newName)
- element.getParent().node.replaceChild(element.getNode(), subTypeProperty.node)
- } else if (element is PsiRelatesTypeConstraint) {
- val typeProperty = TypeQLPsiElementFactory.createRelatesTypeProperty(element.getProject(), newName)
- element.getNode().replaceChild(
- element.getFirstChild().nextSibling.nextSibling.node,
- typeProperty.firstChild.nextSibling.nextSibling.node
- )
- } else if (element is PsiPlaysTypeConstraint) {
- val playsTypeProperty = TypeQLPsiElementFactory.createPlaysTypeProperty(element.getProject(), newName)
- element.getParent().node.replaceChild(element.getNode(), playsTypeProperty.node)
- } else {
- throw UnsupportedOperationException()
- }
- return element
- }
-
- fun findParentByType(
- element: PsiElement,
- ruleElementType: RuleIElementType
- ): PsiTypeQLElement? {
- var parent: PsiElement? = element
- while (parent?.parent.also { parent = it } != null) {
- if (parent is PsiTypeQLElement) {
- val compositeElement = (parent as PsiTypeQLElement).node
- if (compositeElement.elementType === ruleElementType) {
- return compositeElement.psi as PsiTypeQLElement
- }
- }
- }
- return null
- }
-}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiOwnsTypeConstraint.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiOwnsTypeConstraint.kt
deleted file mode 100644
index 822c245..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiOwnsTypeConstraint.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi.constraint
-
-import com.intellij.lang.ASTNode
-import com.intellij.openapi.util.TextRange
-import com.intellij.psi.PsiReference
-import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class PsiOwnsTypeConstraint(node: ASTNode) : PsiTypeQLElement(node) {
- val ownsTypeTextRange: TextRange
- get() = TextRange(4, 4 + ownsType!!.length)
- val ownsType: String?
- get() = if (lastChild != null) {
- lastChild.text
- } else null
- val isAbstractType: Boolean
- get() = ownsType == "abstract"
- val isKey: Boolean
- get() = firstChild != null && firstChild.text == "key"
-
- override fun getReference(): PsiReference? {
- return if (ownsType == null || isAbstractType) {
- null
- } else ReferenceProvidersRegistry.getReferencesFromProviders(this)[0]
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiPlaysTypeConstraint.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiPlaysTypeConstraint.kt
deleted file mode 100644
index b7fb4ed..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiPlaysTypeConstraint.kt
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi.constraint
-
-import com.intellij.lang.ASTNode
-import com.intellij.openapi.util.TextRange
-import com.intellij.psi.PsiReference
-import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class PsiPlaysTypeConstraint(node: ASTNode) : PsiTypeQLElement(node) {
- val playsTypeTextRange: TextRange
- get() {
- val scopeIndex = text.indexOf(":") + 1
- return TextRange(scopeIndex, 6 + playsType!!.length)
- }
- val playsType: String?
- get() = if (lastChild != null) {
- lastChild.text
- } else null
- val isAbstractType: Boolean
- get() = playsType == "abstract"
-
- override fun getReference(): PsiReference? {
- return if (playsType == null || isAbstractType) {
- null
- } else ReferenceProvidersRegistry.getReferencesFromProviders(this)[0]
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiRelatesSuperRoleTypeConstraint.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiRelatesSuperRoleTypeConstraint.kt
deleted file mode 100644
index c60a0c7..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiRelatesSuperRoleTypeConstraint.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi.constraint
-
-import com.intellij.lang.ASTNode
-import com.intellij.psi.PsiReference
-import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class PsiRelatesSuperRoleTypeConstraint(node: ASTNode) : PsiTypeQLElement(node) {
- override fun getReference(): PsiReference? {
- return ReferenceProvidersRegistry.getReferencesFromProviders(this)[0]
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiRelatesTypeConstraint.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiRelatesTypeConstraint.kt
deleted file mode 100644
index 1cb4661..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiRelatesTypeConstraint.kt
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi.constraint
-
-import com.intellij.lang.ASTNode
-import com.intellij.openapi.util.TextRange
-import com.intellij.psi.PsiElement
-import com.intellij.util.IncorrectOperationException
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class PsiRelatesTypeConstraint(node: ASTNode) : PsiTypeQLNamedElement(node) {
-
- override fun getTextRange(): TextRange {
- return TextRange(super.getTextRange().startOffset - "relates ".length, super.getTextRange().endOffset)
- }
-
- override fun getNameIdentifier(): PsiElement? {
- //todo: seems wrong
- if (node.firstChildNode != null && node.firstChildNode.treeNext != null && node.firstChildNode.treeNext.treeNext != null) {
- val idNode: ASTNode? = node.firstChildNode.treeNext.treeNext
- if (idNode != null) {
- return idNode.psi
- }
- }
- return null
- }
-
- @Throws(IncorrectOperationException::class)
- override fun setName(name: String): PsiElement {
- return TypeQLPsiUtils.setName(this, name)
- }
-}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiSubTypeConstraint.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiSubTypeConstraint.kt
deleted file mode 100644
index ca828e2..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiSubTypeConstraint.kt
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi.constraint
-
-import com.intellij.lang.ASTNode
-import com.intellij.openapi.util.TextRange
-import com.intellij.psi.PsiReference
-import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class PsiSubTypeConstraint(node: ASTNode) : PsiTypeQLElement(node) {
- val subTypeTextRange: TextRange
- get() = TextRange(4, 4 + subType!!.length)
- val subType: String?
- get() = if (lastChild != null) {
- lastChild.text
- } else null
-
- override fun getReference(): PsiReference? {
- if (subType == null) {
- return null
- }
- val references = ReferenceProvidersRegistry.getReferencesFromProviders(this)
- return if (references.size > 0) references[0] else null
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeConstraint.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeConstraint.kt
deleted file mode 100644
index df090c3..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeConstraint.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi.constraint
-
-import com.intellij.lang.ASTNode
-import com.intellij.psi.PsiElement
-import com.intellij.util.IncorrectOperationException
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class PsiTypeConstraint(node: ASTNode) : PsiTypeQLNamedElement(node) {
- override fun getNameIdentifier(): PsiElement? {
- //todo: seems wrong
- return node.firstChildNode.psi
- }
-
- @Throws(IncorrectOperationException::class)
- override fun setName(name: String): PsiElement {
- return TypeQLPsiUtils.setName(this, name)
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLAsOverrideTypeBase.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLAsOverrideTypeBase.kt
new file mode 100644
index 0000000..d27b080
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLAsOverrideTypeBase.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+import com.intellij.openapi.util.TextRange
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLReferencingElement
+
+abstract class PsiTypeQLAsOverrideTypeBase(node: ASTNode) : PsiTypeQLReferencingElement(node) {
+ override val labelNode: ASTNode?
+ get() = node
+
+ val superRoleTextRange: TextRange
+ get() = TextRange(0, (name ?: "").length)
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLOwnsAsOverrideType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLOwnsAsOverrideType.kt
new file mode 100644
index 0000000..38b80a6
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLOwnsAsOverrideType.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+
+class PsiTypeQLOwnsAsOverrideType(node: ASTNode) : PsiTypeQLAsOverrideTypeBase(node) {
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLOwnsType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLOwnsType.kt
new file mode 100644
index 0000000..2060044
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLOwnsType.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+import com.intellij.openapi.util.TextRange
+import com.intellij.psi.PsiReference
+import com.vaticle.typeql.grammar.TypeQLParser
+import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLReferencingElement
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+class PsiTypeQLOwnsType(node: ASTNode) : PsiTypeQLReferencingElement(node) {
+ override val labelNode: ASTNode?
+ get() = node.firstChildNode?.treeNext?.treeNext
+
+ val ownsTypeTextRange: TextRange
+ get() = TextRange(tokenTextOffset, tokenTextOffset + ownsType!!.length)
+
+ val ownsType: String?
+ get() = labelNode?.text
+
+ override val tokenText = TypeQLParserDefinition.getTokenText(TypeQLParser.OWNS)
+
+ override fun getName(): String? = this.ownsType
+
+ override fun getReference(): PsiReference? = if (ownsType == null) null else super.getReference()
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLPlaysAsOverrideType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLPlaysAsOverrideType.kt
new file mode 100644
index 0000000..4c91d7b
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLPlaysAsOverrideType.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+
+class PsiTypeQLPlaysAsOverrideType(node: ASTNode) : PsiTypeQLAsOverrideTypeBase(node) {
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLPlaysType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLPlaysType.kt
new file mode 100644
index 0000000..d4aec97
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLPlaysType.kt
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+import com.intellij.openapi.util.TextRange
+import com.intellij.psi.PsiReference
+import com.vaticle.typeql.grammar.TypeQLParser
+import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLReferencingElement
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+class PsiTypeQLPlaysType(node: ASTNode) : PsiTypeQLReferencingElement(node) {
+ override val labelNode: ASTNode?
+ get() = node.firstChildNode?.treeNext?.treeNext
+
+ val playsTypeTextRange: TextRange
+ get() {
+ val scopeIndex = text.indexOf(rolePrefix) + 1
+ val superRoleIndex = text.indexOf(asTokenText)
+ val endIndex = if (superRoleIndex == -1) tokenTextOffset + playsType!!.length else superRoleIndex
+
+ return if (scopeIndex <= endIndex) TextRange(scopeIndex, endIndex) else TextRange(0, 0)
+ }
+
+ override val tokenText = TypeQLParserDefinition.getTokenText(TypeQLParser.PLAYS)
+ private val asTokenText = TypeQLParserDefinition.getTokenText(TypeQLParser.AS)
+ private val rolePrefix = ":"
+
+ val playsType: String?
+ get() = labelNode?.text
+
+ val playsScope: String?
+ get() {
+ if (playsType == null) {
+ return null
+ }
+
+ val scopeIndex = playsType!!.indexOf(rolePrefix)
+ return playsType!!.substring(0, scopeIndex)
+ }
+
+ fun buildScopedName(newName: String): String {
+ return playsScope + rolePrefix + newName
+ }
+
+ override fun getName(): String? = this.playsType
+
+ override fun getReference(): PsiReference? = if (playsType == null) null else super.getReference()
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLRelatesAsOverrideType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLRelatesAsOverrideType.kt
new file mode 100644
index 0000000..b8fb63d
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLRelatesAsOverrideType.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+class PsiTypeQLRelatesAsOverrideType(node: ASTNode) : PsiTypeQLAsOverrideTypeBase(node) {
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLRelatesType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLRelatesType.kt
new file mode 100644
index 0000000..546aceb
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLRelatesType.kt
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+import com.intellij.openapi.util.TextRange
+import com.intellij.psi.PsiElement
+import com.intellij.util.IncorrectOperationException
+import com.vaticle.typeql.grammar.TypeQLParser
+import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElementFactory
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLStatementType
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+class PsiTypeQLRelatesType(node: ASTNode) : PsiTypeQLNamedElement(node) {
+ override val labelNode: ASTNode?
+ get() = node.firstChildNode?.treeNext?.treeNext
+
+ override val scopedName: String?
+ get() {
+ val statement = parent as PsiTypeQLStatementType
+ return String.format("%s:%s", statement.name, name)
+ }
+
+ override val tokenText = TypeQLParserDefinition.getTokenText(TypeQLParser.RELATES)
+
+ override fun getTextRange(): TextRange? {
+ val fullTextRange = super.getTextRange() ?: return null
+ return TextRange(fullTextRange.startOffset - tokenTextOffset, fullTextRange.endOffset)
+ }
+
+ override fun getNameIdentifier(): PsiElement? {
+ return labelNode?.psi
+ }
+
+ @Throws(IncorrectOperationException::class)
+ override fun setName(name: String): PsiElement {
+ val typeProperty = PsiTypeQLElementFactory.createRelatesTypeProperty(project, name) ?: return this
+
+ if (labelNode == null || typeProperty.labelNode == null) {
+ throw NullPointerException("Cannot access label node for $this")
+ }
+
+ node.replaceChild(labelNode!!, typeProperty.labelNode!!)
+ return this
+ }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLSubType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLSubType.kt
new file mode 100644
index 0000000..9db71a7
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLSubType.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+import com.intellij.openapi.util.TextRange
+import com.intellij.psi.PsiReference
+import com.vaticle.typeql.grammar.TypeQLParser
+import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLReferencingElement
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+class PsiTypeQLSubType(node: ASTNode) : PsiTypeQLReferencingElement(node) {
+ override val labelNode: ASTNode?
+ get() = node.lastChildNode
+
+ val subTypeTextRange: TextRange
+ get() = TextRange(tokenTextOffset, tokenTextOffset + subType!!.length)
+
+ val subType: String?
+ get() = labelNode?.text
+
+ override val tokenText = TypeQLParserDefinition.getTokenText(TypeQLParser.SUB)
+
+ override fun getName(): String? = this.subType
+
+ override fun getReference(): PsiReference? = if (subType == null) null else super.getReference()
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLType.kt
new file mode 100644
index 0000000..23fa52a
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/constraint/PsiTypeQLType.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.psi.constraint
+
+import com.intellij.lang.ASTNode
+import com.intellij.psi.PsiElement
+import com.intellij.util.IncorrectOperationException
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElementFactory
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
+
+/**
+ * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
+ */
+class PsiTypeQLType(node: ASTNode) : PsiTypeQLNamedElement(node) {
+ override val labelNode: ASTNode?
+ get() = node.firstChildNode
+
+ override fun getNameIdentifier(): PsiElement? {
+ return labelNode?.psi
+ }
+
+ @Throws(IncorrectOperationException::class)
+ override fun setName(name: String): PsiElement {
+ val typeProperty = PsiTypeQLElementFactory.createTypeProperty(project, name) ?: return this
+
+ if (labelNode == null || typeProperty.labelNode == null) {
+ throw NullPointerException("Cannot access label node for $this")
+ }
+
+ node.replaceChild(labelNode!!, typeProperty.labelNode!!)
+ return this
+ }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/statement/PsiStatementType.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/statement/PsiStatementType.kt
deleted file mode 100644
index 847c629..0000000
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/psi/statement/PsiStatementType.kt
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains.psi.statement
-
-import com.intellij.lang.ASTNode
-import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.*
-
-/**
- * @author [Brandon Fergerson](mailto:bfergerson@apache.org)
- */
-class PsiStatementType(node: ASTNode) : PsiTypeQLElement(node) {
-
- override fun getName(): String? = firstChild.text
-
- //todo: seems wrong
- val subType: String?
- get() = if (node.firstChildNode == null ||
- node.firstChildNode.treeNext == null ||
- node.firstChildNode.treeNext.treeNext == null ||
- node.firstChildNode.treeNext.treeNext.lastChildNode == null
- ) {
- null
- } else node.firstChildNode.treeNext.treeNext.lastChildNode.text
-
- fun findRelatesTypeProperties(): List {
- val relatesTypes: MutableList = ArrayList()
- for (child in children) {
- val element = TypeQLParserDefinition.getRuleTypePropertyElement(child.node)
- if (element is PsiRelatesTypeConstraint) {
- relatesTypes.add(element)
- }
- }
- return relatesTypes
- }
-
- fun findPlaysTypeProperties(): List {
- val playsTypes: MutableList = ArrayList()
- for (child in children) {
- val element = TypeQLParserDefinition.getRuleTypePropertyElement(child.node)
- if (element is PsiPlaysTypeConstraint) {
- playsTypes.add(element)
- }
- }
- return playsTypes
- }
-
- fun findOwnsTypeProperties(): List {
- val ownsTypes: MutableList = ArrayList()
- for (child in children) {
- val element = TypeQLParserDefinition.getRuleTypePropertyElement(child.node)
- if (element is PsiOwnsTypeConstraint) {
- ownsTypes.add(element)
- }
- }
- return ownsTypes
- }
-
- fun findSubTypeProperties(): List {
- val subTypes: MutableList = ArrayList()
- for (child in children) {
- val element = TypeQLParserDefinition.getRuleTypePropertyElement(child.node)
- if (element is PsiSubTypeConstraint) {
- subTypes.add(element)
- }
- }
- return subTypes
- }
-
- fun findTypeProperties(): List {
- val relatesTypes: MutableList = ArrayList()
- for (child in children) {
- val element = TypeQLParserDefinition.getRuleTypeElement(child.node)
- if (element is PsiTypeConstraint) {
- relatesTypes.add(element)
- }
- }
- return relatesTypes
- }
-}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLCommenter.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLCommenter.kt
index 274c7aa..0fd2c55 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLCommenter.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLCommenter.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.refactor
import com.intellij.codeInsight.generation.CommenterDataHolder
@@ -113,4 +134,4 @@ class TypeQLCommenter : Commenter, SelfManagingCommenter {
companion object {
const val HASH_COMMENT_PREFIX = "#"
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLNamesValidator.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLNamesValidator.kt
index 253a254..8187d7d 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLNamesValidator.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLNamesValidator.kt
@@ -1,24 +1,45 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.refactor
import com.intellij.lang.refactoring.NamesValidator
import com.intellij.openapi.project.Project
-import org.typedb.typeql.plugin.jetbrains.TypeQLParser
+import com.vaticle.typeql.grammar.TypeQLParser
import java.util.*
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
*/
-class TypeQLNamesValidator : NamesValidator {
- override fun isKeyword(name: String, project: Project): Boolean {
- return GRAQL_KEYWORDS.contains("'$name'")
- }
-
- override fun isIdentifier(name: String, project: Project): Boolean {
- return !isKeyword(name, project)
- }
-
- companion object {
- //todo: filter for real keywords ("VAR_" isn't keyword)
- val GRAQL_KEYWORDS: Set = HashSet(Arrays.asList(*TypeQLParser.tokenNames))
- }
-}
\ No newline at end of file
+//class TypeQLNamesValidator : NamesValidator {
+// override fun isKeyword(name: String, project: Project): Boolean {
+// return TYPEQL_KEYWORDS.contains("'$name'")
+// }
+//
+// override fun isIdentifier(name: String, project: Project): Boolean {
+// return !isKeyword(name, project)
+// }
+//
+// companion object {
+// // TODO: filter for real keywords ("VAR_" isn't keyword)
+// val TYPEQL_KEYWORDS: Set = HashSet(Arrays.asList(*TypeQLParser.tokenNames))
+// }
+//}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLRefactoringSupportProvider.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLRefactoringSupportProvider.kt
index d18fa6f..2e47dd8 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLRefactoringSupportProvider.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/refactor/TypeQLRefactoringSupportProvider.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.refactor
import com.intellij.lang.refactoring.RefactoringSupportProvider
@@ -15,4 +36,4 @@ class TypeQLRefactoringSupportProvider : RefactoringSupportProvider() {
override fun isMemberInplaceRenameAvailable(element: PsiElement, context: PsiElement?): Boolean {
return element is PsiTypeQLNamedElement
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/reference/TypeQLReference.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/reference/TypeQLReference.kt
index bb9c0f9..1046c29 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/reference/TypeQLReference.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/reference/TypeQLReference.kt
@@ -1,44 +1,95 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.reference
import com.intellij.openapi.util.TextRange
import com.intellij.psi.*
import com.intellij.util.IncorrectOperationException
import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiOwnsTypeConstraint
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElementFactory
+import org.typedb.typeql.plugin.jetbrains.psi.constraint.*
+import org.typedb.typeql.plugin.jetbrains.usage.TypeQLDeclarationFinder
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
*/
class TypeQLReference(element: PsiTypeQLElement, textRange: TextRange) :
- PsiReferenceBase(element, textRange), PsiPolyVariantReference {
+ PsiReferenceBase(element, textRange) {
+ @Throws(IncorrectOperationException::class)
+ override fun handleElementRename(newName: String): PsiElement {
+ if (myElement == null) {
+ throw UnsupportedOperationException("Cannot handle element renaming for not existing element $element")
+ }
+
+ val tempProperty: PsiTypeQLElement?
+ val renamingElement = myElement!!
+
+ when (renamingElement) {
+ is PsiTypeQLSubType -> tempProperty =
+ PsiTypeQLElementFactory.createSubTypeProperty(renamingElement.project, newName)
+
+ is PsiTypeQLPlaysType -> tempProperty =
+ PsiTypeQLElementFactory.createPlaysTypeProperty(
+ renamingElement.project, renamingElement.buildScopedName(newName)
+ )
+
+ is PsiTypeQLOwnsType -> tempProperty =
+ PsiTypeQLElementFactory.createOwnsTypeProperty(renamingElement.project, newName)
- override fun getRangeInElement(): TextRange {
- return if (element is PsiOwnsTypeConstraint) {
- TextRange(super.getRangeInElement().startOffset + 1, super.getRangeInElement().endOffset + 1)
- } else {
- super.getRangeInElement()
+ is PsiTypeQLRelatesAsOverrideType -> tempProperty =
+ PsiTypeQLElementFactory.createRelatesAsOverrideTypeProperty(renamingElement.project, newName)
+
+ is PsiTypeQLPlaysAsOverrideType -> tempProperty =
+ PsiTypeQLElementFactory.createPlaysAsOverrideTypeProperty(renamingElement.project, newName)
+
+ is PsiTypeQLOwnsAsOverrideType -> tempProperty =
+ PsiTypeQLElementFactory.createOwnsAsOverrideTypeProperty(renamingElement.project, newName)
+
+ else -> throw UnsupportedOperationException("Cannot set name to this element $element")
}
- }
- @Throws(IncorrectOperationException::class)
- override fun handleElementRename(newElementName: String): PsiElement {
- return TypeQLPsiUtils.setName(myElement!!, newElementName)
- }
+ if (tempProperty != null) {
+ if (renamingElement.labelNode == null || tempProperty.labelNode == null) {
+ throw NullPointerException("Cannot access label node for $this")
+ }
- override fun multiResolve(incompleteCode: Boolean): Array {
- val results: MutableList = ArrayList()
- for (identifier in TypeQLPsiUtils.findUsages(myElement!!)) {
- results.add(PsiElementResolveResult(identifier))
+ renamingElement.labelNode!!.treeParent.replaceChild(
+ renamingElement.labelNode!!, tempProperty.labelNode!!
+ )
}
- return results.toTypedArray()
+
+ return renamingElement
}
override fun resolve(): PsiElement? {
- return TypeQLPsiUtils.findDeclaration(myElement!!.project, myElement!!)
+ return TypeQLDeclarationFinder.findDeclaration(myElement!!.project, myElement!!)
}
override fun getVariants(): Array {
return emptyArray()
}
+
+ override fun toString(): String = String.format(
+ "%s(%s)",
+ javaClass.simpleName, myElement?.node
+ )
}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/reference/TypeQLReferenceContributor.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/reference/TypeQLReferenceContributor.kt
index 650950d..93e6937 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/reference/TypeQLReferenceContributor.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/reference/TypeQLReferenceContributor.kt
@@ -1,73 +1,119 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.reference
-import com.intellij.openapi.util.TextRange
import com.intellij.patterns.PlatformPatterns
import com.intellij.psi.*
import com.intellij.util.ProcessingContext
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiOwnsTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiPlaysTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiRelatesSuperRoleTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiSubTypeConstraint
+import org.typedb.typeql.plugin.jetbrains.psi.constraint.*
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
*/
class TypeQLReferenceContributor : PsiReferenceContributor() {
override fun registerReferenceProviders(registrar: PsiReferenceRegistrar) {
+
registrar.registerReferenceProvider(
- PlatformPatterns.psiElement(PsiOwnsTypeConstraint::class.java),
+ PlatformPatterns.psiElement(PsiTypeQLOwnsAsOverrideType::class.java),
object : PsiReferenceProvider() {
override fun getReferencesByElement(
element: PsiElement,
context: ProcessingContext
): Array {
- val ownsElement = element as PsiOwnsTypeConstraint
+ val typeElement = element as PsiTypeQLOwnsAsOverrideType
return arrayOf(
- TypeQLReference(ownsElement, ownsElement.ownsTypeTextRange)
+ TypeQLReference(typeElement, typeElement.superRoleTextRange)
)
}
})
+
registrar.registerReferenceProvider(
- PlatformPatterns.psiElement(PsiPlaysTypeConstraint::class.java),
+ PlatformPatterns.psiElement(PsiTypeQLPlaysAsOverrideType::class.java),
object : PsiReferenceProvider() {
override fun getReferencesByElement(
element: PsiElement,
context: ProcessingContext
): Array {
- val playsElement = element as PsiPlaysTypeConstraint
+ val typeElement = element as PsiTypeQLPlaysAsOverrideType
+ return arrayOf(
+ TypeQLReference(typeElement, typeElement.superRoleTextRange)
+ )
+ }
+ })
+
+ registrar.registerReferenceProvider(
+ PlatformPatterns.psiElement(PsiTypeQLRelatesAsOverrideType::class.java),
+ object : PsiReferenceProvider() {
+ override fun getReferencesByElement(
+ element: PsiElement,
+ context: ProcessingContext
+ ): Array {
+ val typeElement = element as PsiTypeQLRelatesAsOverrideType
+ return arrayOf(
+ TypeQLReference(typeElement, typeElement.superRoleTextRange)
+ )
+ }
+ })
+
+ registrar.registerReferenceProvider(
+ PlatformPatterns.psiElement(PsiTypeQLPlaysType::class.java),
+ object : PsiReferenceProvider() {
+ override fun getReferencesByElement(
+ element: PsiElement,
+ context: ProcessingContext
+ ): Array {
+ val playsElement = element as PsiTypeQLPlaysType
return arrayOf(
TypeQLReference(playsElement, playsElement.playsTypeTextRange)
)
}
})
- registrar.registerReferenceProvider(PlatformPatterns.psiElement(
- PsiRelatesSuperRoleTypeConstraint::class.java
- ), object : PsiReferenceProvider() {
- override fun getReferencesByElement(
- element: PsiElement,
- context: ProcessingContext
- ): Array {
- val relatesSuperRoleElement = element as PsiRelatesSuperRoleTypeConstraint
- return arrayOf(
- TypeQLReference(
- relatesSuperRoleElement,
- TextRange(0, relatesSuperRoleElement.text.length)
+
+ registrar.registerReferenceProvider(
+ PlatformPatterns.psiElement(PsiTypeQLOwnsType::class.java),
+ object : PsiReferenceProvider() {
+ override fun getReferencesByElement(
+ element: PsiElement,
+ context: ProcessingContext
+ ): Array {
+ val playsElement = element as PsiTypeQLOwnsType
+ return arrayOf(
+ TypeQLReference(playsElement, playsElement.ownsTypeTextRange)
)
- )
- }
- })
+ }
+ })
+
registrar.registerReferenceProvider(
- PlatformPatterns.psiElement(PsiSubTypeConstraint::class.java),
+ PlatformPatterns.psiElement(PsiTypeQLSubType::class.java),
object : PsiReferenceProvider() {
override fun getReferencesByElement(
element: PsiElement,
context: ProcessingContext
): Array {
- val subTypeElement = element as PsiSubTypeConstraint
+ val subTypeElement = element as PsiTypeQLSubType
return arrayOf(
TypeQLReference(subTypeElement, subTypeElement.subTypeTextRange)
)
}
})
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/usage/TypeQLDeclarationFinder.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/usage/TypeQLDeclarationFinder.kt
new file mode 100644
index 0000000..597c885
--- /dev/null
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/usage/TypeQLDeclarationFinder.kt
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.usage
+
+import com.intellij.ide.scratch.ScratchUtil
+import com.intellij.openapi.project.Project
+import com.intellij.openapi.vfs.VirtualFile
+import com.intellij.psi.PsiManager
+import com.intellij.psi.search.FileTypeIndex
+import com.intellij.psi.search.GlobalSearchScope
+import com.intellij.psi.util.PsiTreeUtil
+import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLFile
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
+
+object TypeQLDeclarationFinder {
+ fun findDeclaration(project: Project, identifier: PsiTypeQLElement): PsiTypeQLNamedElement? {
+ val declarations = findDeclarations(project, identifier)
+ return if (declarations.isNotEmpty()) declarations[0] else null
+ }
+
+ fun findDeclaration(
+ project: Project,
+ targetName: String?,
+ searchScope: Collection
+ ): PsiTypeQLNamedElement? {
+ val declarations = findDeclarations(project, targetName, searchScope)
+ return if (declarations.isNotEmpty()) declarations[0] else null
+ }
+
+ fun findDeclarations(
+ project: Project,
+ identifier: PsiTypeQLElement
+ ): List {
+ val identifierFile = identifier.node.psi.containingFile.virtualFile
+
+ return if (ScratchUtil.isScratch(identifierFile)) {
+ findDeclarations(project, identifier.scopedName, listOf(identifierFile))
+ } else {
+ findDeclarations(
+ project, identifier.scopedName, FileTypeIndex.getFiles(
+ TypeQLFileType.INSTANCE, GlobalSearchScope.allScope(project)
+ )
+ )
+ }
+ }
+
+ fun findDeclarations(
+ project: Project,
+ targetName: String?,
+ searchScope: Collection
+ ): List {
+ if (targetName == null) {
+ return emptyList()
+ }
+
+ val scopedNameDeclarations: MutableList = ArrayList()
+ val nameDeclarations: MutableList = ArrayList()
+
+ for (virtualFile in searchScope) {
+ val typeqlFile = PsiManager.getInstance(project).findFile(virtualFile!!) as PsiTypeQLFile? ?: continue
+
+ val namedElements = PsiTreeUtil.collectElementsOfType(typeqlFile, PsiTypeQLNamedElement::class.java)
+
+ for (namedElement in namedElements) {
+ if (targetName == namedElement.scopedName) {
+ scopedNameDeclarations.add(namedElement)
+ }
+
+ if (targetName == namedElement.name) {
+ nameDeclarations.add(namedElement)
+ }
+ }
+ }
+
+ return scopedNameDeclarations + nameDeclarations
+ }
+}
diff --git a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/usage/TypeQLFindUsagesProvider.kt b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/usage/TypeQLFindUsagesProvider.kt
index ec8a383..bf5fd31 100644
--- a/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/usage/TypeQLFindUsagesProvider.kt
+++ b/src/main/kotlin/org/typedb/typeql/plugin/jetbrains/usage/TypeQLFindUsagesProvider.kt
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package org.typedb.typeql.plugin.jetbrains.usage
import com.intellij.lang.cacheBuilder.DefaultWordsScanner
@@ -5,34 +26,28 @@ import com.intellij.lang.cacheBuilder.WordsScanner
import com.intellij.lang.findUsages.FindUsagesProvider
import com.intellij.psi.PsiElement
import com.intellij.psi.tree.TokenSet
-import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
-import org.typedb.typeql.plugin.jetbrains.TypeQLLexer
-import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
-import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLNamedElement
-import org.typedb.typeql.plugin.jetbrains.psi.TypeQLPsiUtils
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiRelatesTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiSubTypeConstraint
-import org.typedb.typeql.plugin.jetbrains.psi.constraint.PsiTypeConstraint
+import com.vaticle.typeql.grammar.TypeQLLexer
import org.antlr.intellij.adaptor.lexer.ANTLRLexerAdaptor
+import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+import org.typedb.typeql.plugin.jetbrains.TypeQLLanguage
+import org.typedb.typeql.plugin.jetbrains.TypeQLTokenSets
+import org.typedb.typeql.plugin.jetbrains.psi.PsiTypeQLElement
/**
* @author [Brandon Fergerson](mailto:bfergerson@apache.org)
*/
class TypeQLFindUsagesProvider : FindUsagesProvider {
override fun getWordsScanner(): WordsScanner? {
- val lexer = TypeQLLexer(null)
return DefaultWordsScanner(
- ANTLRLexerAdaptor(TypeQLLanguage.INSTANCE, lexer),
- TypeQLParserDefinition.Companion.IDS,
- TypeQLParserDefinition.Companion.COMMENTS,
+ ANTLRLexerAdaptor(TypeQLLanguage.INSTANCE, TypeQLLexer(null)),
+ TypeQLTokenSets.IDENTIFIERS,
+ TypeQLTokenSets.COMMENTS,
TokenSet.EMPTY
)
}
- override fun canFindUsagesFor(psiElement: PsiElement): Boolean {
- return (psiElement is PsiTypeConstraint
- || psiElement is PsiSubTypeConstraint
- || psiElement is PsiRelatesTypeConstraint)
+ override fun canFindUsagesFor(element: PsiElement): Boolean {
+ return element is PsiTypeQLElement
}
override fun getHelpId(psiElement: PsiElement): String? {
@@ -40,25 +55,14 @@ class TypeQLFindUsagesProvider : FindUsagesProvider {
}
override fun getType(element: PsiElement): String {
- return if (element is PsiTypeQLNamedElement) {
- val declarationType = TypeQLPsiUtils.determineDeclarationType(element)
- if (declarationType != null) {
- "TypeQL $declarationType"
- } else {
- "TypeQL element"
- }
- } else {
- //todo: can this happen?
- ""
- }
+ return if (element is PsiTypeQLElement) "${TypeQLFileType.LANG_NAME} element" else ""
}
override fun getDescriptiveName(element: PsiElement): String {
- return element.text
+ return if (element is PsiTypeQLElement) element.scopedName!! else ""
}
override fun getNodeText(element: PsiElement, useFullName: Boolean): String {
- val namedElement = element as PsiTypeQLNamedElement
- return namedElement.name!!
+ return if (element is PsiTypeQLElement) element.name!! else ""
}
-}
\ No newline at end of file
+}
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 1694afb..fbaa788 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -1,3 +1,24 @@
+
+
org.typedb.typeql.plugin.jetbrains
TypeQL
@@ -6,36 +27,57 @@
com.intellij.modules.lang
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/colorSchemes/ClassicLightTypeQL.icls b/src/main/resources/colorSchemes/ClassicLightTypeQL.icls
new file mode 100644
index 0000000..140f2cc
--- /dev/null
+++ b/src/main/resources/colorSchemes/ClassicLightTypeQL.icls
@@ -0,0 +1,87 @@
+
+
+ 2024-02-19T11:56:25
+ Idea
+ 2023.2.1.0.0
+ 2024-02-19T11:56:37
+ Classic Light TypeQL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/colorSchemes/DarculaTypeQL.icls b/src/main/resources/colorSchemes/DarculaTypeQL.icls
new file mode 100644
index 0000000..6e5f5dc
--- /dev/null
+++ b/src/main/resources/colorSchemes/DarculaTypeQL.icls
@@ -0,0 +1,87 @@
+
+
+ 2024-02-19T11:51:58
+ Idea
+ 2023.2.1.0.0
+ 2024-02-19T11:52:01
+ Darcula TypeQL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/colorSchemes/DarkTypeQL.icls b/src/main/resources/colorSchemes/DarkTypeQL.icls
new file mode 100644
index 0000000..944d842
--- /dev/null
+++ b/src/main/resources/colorSchemes/DarkTypeQL.icls
@@ -0,0 +1,87 @@
+
+
+ 2024-02-19T11:51:58
+ Idea
+ 2023.2.1.0.0
+ 2024-02-19T11:52:01
+ Dark TypeQL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/colorSchemes/LightTypeQL.icls b/src/main/resources/colorSchemes/LightTypeQL.icls
new file mode 100644
index 0000000..5e071d2
--- /dev/null
+++ b/src/main/resources/colorSchemes/LightTypeQL.icls
@@ -0,0 +1,87 @@
+
+
+ 2024-02-19T11:56:25
+ Idea
+ 2023.2.1.0.0
+ 2024-02-19T11:56:37
+ Light TypeQL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLParsingTest.kt b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLParsingTest.kt
deleted file mode 100644
index 8b38815..0000000
--- a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/TypeQLParsingTest.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.typedb.typeql.plugin.jetbrains
-
-import com.intellij.testFramework.ParsingTestCase
-
-class TypeQLParsingTest : ParsingTestCase("", "tql", TypeQLParserDefinition()) {
-
- fun testParsingTestData() {
- doTest(true)
- }
-
- override fun getTestDataPath(): String = "src/test/resources"
- override fun skipSpaces(): Boolean = false
- override fun includeRanges(): Boolean = true
-}
diff --git a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectDefinesTest.kt b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectDefinesTest.kt
new file mode 100644
index 0000000..e4753c0
--- /dev/null
+++ b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectDefinesTest.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.test.parsing
+
+class CorrectDefinesTest : TypeQLParsingTestBase() {
+ override fun getTestDataSubdir(): String = "correct_defines"
+}
diff --git a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectInsertsTest.kt b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectInsertsTest.kt
new file mode 100644
index 0000000..421e940
--- /dev/null
+++ b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectInsertsTest.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.test.parsing
+
+class CorrectInsertsTest : TypeQLParsingTestBase() {
+ override fun getTestDataSubdir(): String = "correct_inserts"
+}
diff --git a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectMatchTest.kt b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectMatchTest.kt
new file mode 100644
index 0000000..26535d7
--- /dev/null
+++ b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/CorrectMatchTest.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.test.parsing
+
+class CorrectMatchTest : TypeQLParsingTestBase() {
+ override fun getTestDataSubdir(): String = "correct_match"
+}
diff --git a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectMatchTest.kt b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectMatchTest.kt
new file mode 100644
index 0000000..e285885
--- /dev/null
+++ b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectMatchTest.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.test.parsing
+
+class IncorrectMatchTest : TypeQLParsingTestBase() {
+ override fun getTestDataSubdir(): String = "incorrect_match"
+}
diff --git a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectNoDefineTest.kt b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectNoDefineTest.kt
new file mode 100644
index 0000000..bd9f7cd
--- /dev/null
+++ b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectNoDefineTest.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.test.parsing
+
+class IncorrectNoDefineTest : TypeQLParsingTestBase() {
+ override fun getTestDataSubdir(): String = "incorrect_no_define"
+}
diff --git a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectWithDefineTest.kt b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectWithDefineTest.kt
new file mode 100644
index 0000000..5771034
--- /dev/null
+++ b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/IncorrectWithDefineTest.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.test.parsing
+
+class IncorrectWithDefineTest : TypeQLParsingTestBase() {
+ override fun getTestDataSubdir(): String = "incorrect_with_define"
+}
diff --git a/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/TypeQLParsingTestBase.kt b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/TypeQLParsingTestBase.kt
new file mode 100644
index 0000000..8f5b2ff
--- /dev/null
+++ b/src/test/kotlin/org/typedb/typeql/plugin/jetbrains/test/parsing/TypeQLParsingTestBase.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Vaticle
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.typedb.typeql.plugin.jetbrains.test.parsing
+
+import com.intellij.testFramework.ParsingTestCase
+import org.typedb.typeql.plugin.jetbrains.TypeQLFileType
+import org.typedb.typeql.plugin.jetbrains.TypeQLParserDefinition
+
+open abstract class TypeQLParsingTestBase() : ParsingTestCase("", TypeQLFileType.EXTENSION, TypeQLParserDefinition()) {
+
+ fun testParsingTestData() {
+ doTest(true)
+ }
+
+ override fun getTestDataPath(): String = "src/test/resources/parsing/${getTestDataSubdir()}"
+ override fun skipSpaces(): Boolean = false
+ override fun includeRanges(): Boolean = true
+ abstract fun getTestDataSubdir(): String
+}
diff --git a/src/test/resources/ParsingTestData.tql b/src/test/resources/ParsingTestData.tql
deleted file mode 100644
index 9b5dcbd..0000000
--- a/src/test/resources/ParsingTestData.tql
+++ /dev/null
@@ -1,39 +0,0 @@
-define
-
-title sub attribute,
- value string;
-
-event-date sub attribute,
- abstract,
- value datetime;
-approved-date sub event-date;
-
-## an abstract relation, only to be subtyped by other relations
-request sub relation,
- abstract,
- owns approved-date,
- relates approved-subject,
- relates requester,
- relates respondent;
-
-friendship sub relation,
- relates friend,
- plays friend-request:approved-friendship,
- plays friends-list:listed-friendship;
-
-## an example of subtyping in TypeDB
-friend-request sub request,
- relates approved-friendship as approved-subject,
- relates friendship-requester as requester,
- relates friendship-respondent as respondent;
-
-friends-list sub relation,
- owns title,
- relates list-owner,
- relates listed-friendship;
-
-person sub entity,
- plays friendship:friend,
- plays friend-request:friendship-requester,
- plays friend-request:friendship-respondent,
- plays friends-list:list-owner;
\ No newline at end of file
diff --git a/src/test/resources/ParsingTestData.txt b/src/test/resources/ParsingTestData.txt
deleted file mode 100644
index 41f29ce..0000000
--- a/src/test/resources/ParsingTestData.txt
+++ /dev/null
@@ -1,322 +0,0 @@
-TypeQL Language file(0,950)
- PsiTypeQLElement(eof_queries) - Location: (0,950)(0,950)
- PsiTypeQLElement(query) - Location: (0,950)(0,950)
- PsiTypeQLElement(query_define) - Location: (0,950)(0,950)
- PsiElement('define')('define')(0,6)
- PsiWhiteSpace('\n\n')(6,8)
- PsiTypeQLElement(definables) - Location: (8,950)(8,950)
- PsiTypeQLElement(definable) - Location: (8,43)(8,43)
- PsiStatementType(variable_type) - Location: (8,43)(8,43)
- PsiTypeQLElement(type_any) - Location: (8,13)(8,13)
- PsiTypeConstraint(type) - Name: title - Location: (8,13)(8,13)
- PsiTypeQLElement(label) - Location: (8,13)(8,13)
- PsiElement(LABEL_)('title')(8,13)
- PsiWhiteSpace(' ')(13,14)
- PsiTypeQLElement(type_constraint) - Location: (14,27)(14,27)
- PsiElement(SUB_)('sub')(14,17)
- PsiWhiteSpace(' ')(17,18)
- PsiTypeQLElement(type_any) - Location: (18,27)(18,27)
- PsiTypeQLElement(type) - Location: (18,27)(18,27)
- PsiTypeQLElement(label) - Location: (18,27)(18,27)
- PsiTypeQLElement(type_native) - Location: (18,27)(18,27)
- PsiElement('attribute')('attribute')(18,27)
- PsiElement(',')(',')(27,28)
- PsiWhiteSpace('\n ')(28,31)
- PsiTypeQLElement(type_constraint) - Location: (31,43)(31,43)
- PsiElement('value')('value')(31,36)
- PsiWhiteSpace(' ')(36,37)
- PsiTypeQLElement(value_type) - Location: (37,43)(37,43)
- PsiElement('string')('string')(37,43)
- PsiElement(';')(';')(43,44)
- PsiWhiteSpace('\n\n')(44,46)
- PsiTypeQLElement(definable) - Location: (46,100)(46,100)
- PsiStatementType(variable_type) - Location: (46,100)(46,100)
- PsiTypeQLElement(type_any) - Location: (46,56)(46,56)
- PsiTypeConstraint(type) - Name: event-date - Location: (46,56)(46,56)
- PsiTypeQLElement(label) - Location: (46,56)(46,56)
- PsiElement(LABEL_)('event-date')(46,56)
- PsiWhiteSpace(' ')(56,57)
- PsiTypeQLElement(type_constraint) - Location: (57,70)(57,70)
- PsiElement(SUB_)('sub')(57,60)
- PsiWhiteSpace(' ')(60,61)
- PsiTypeQLElement(type_any) - Location: (61,70)(61,70)
- PsiTypeQLElement(type) - Location: (61,70)(61,70)
- PsiTypeQLElement(label) - Location: (61,70)(61,70)
- PsiTypeQLElement(type_native) - Location: (61,70)(61,70)
- PsiElement('attribute')('attribute')(61,70)
- PsiElement(',')(',')(70,71)
- PsiWhiteSpace('\n ')(71,74)
- PsiTypeQLElement(type_constraint) - Location: (74,82)(74,82)
- PsiElement('abstract')('abstract')(74,82)
- PsiElement(',')(',')(82,83)
- PsiWhiteSpace('\n ')(83,86)
- PsiTypeQLElement(type_constraint) - Location: (86,100)(86,100)
- PsiElement('value')('value')(86,91)
- PsiWhiteSpace(' ')(91,92)
- PsiTypeQLElement(value_type) - Location: (92,100)(92,100)
- PsiElement('datetime')('datetime')(92,100)
- PsiElement(';')(';')(100,101)
- PsiWhiteSpace('\n')(101,102)
- PsiTypeQLElement(definable) - Location: (102,130)(102,130)
- PsiStatementType(variable_type) - Location: (102,130)(102,130)
- PsiTypeQLElement(type_any) - Location: (102,115)(102,115)
- PsiTypeConstraint(type) - Name: approved-date - Location: (102,115)(102,115)
- PsiTypeQLElement(label) - Location: (102,115)(102,115)
- PsiElement(LABEL_)('approved-date')(102,115)
- PsiWhiteSpace(' ')(115,116)
- PsiSubTypeConstraint(type_constraint) - Location: (116,130)(116,130)
- PsiElement(SUB_)('sub')(116,119)
- PsiWhiteSpace(' ')(119,120)
- PsiTypeQLElement(type_any) - Location: (120,130)(120,130)
- PsiTypeQLElement(type) - Location: (120,130)(120,130)
- PsiTypeQLElement(label) - Location: (120,130)(120,130)
- PsiElement(LABEL_)('event-date')(120,130)
- PsiElement(';')(';')(130,131)
- PsiWhiteSpace('\n\n')(131,133)
- PsiComment(COMMENT)('## an abstract relation, only to be subtyped by other relations\n')(133,197)
- PsiTypeQLElement(definable) - Location: (197,322)(197,322)
- PsiStatementType(variable_type) - Location: (197,322)(197,322)
- PsiTypeQLElement(type_any) - Location: (197,204)(197,204)
- PsiTypeConstraint(type) - Name: request - Location: (197,204)(197,204)
- PsiTypeQLElement(label) - Location: (197,204)(197,204)
- PsiElement(LABEL_)('request')(197,204)
- PsiWhiteSpace(' ')(204,205)
- PsiTypeQLElement(type_constraint) - Location: (205,217)(205,217)
- PsiElement(SUB_)('sub')(205,208)
- PsiWhiteSpace(' ')(208,209)
- PsiTypeQLElement(type_any) - Location: (209,217)(209,217)
- PsiTypeQLElement(type) - Location: (209,217)(209,217)
- PsiTypeQLElement(label) - Location: (209,217)(209,217)
- PsiTypeQLElement(type_native) - Location: (209,217)(209,217)
- PsiElement('relation')('relation')(209,217)
- PsiElement(',')(',')(217,218)
- PsiWhiteSpace('\n ')(218,221)
- PsiTypeQLElement(type_constraint) - Location: (221,229)(221,229)
- PsiElement('abstract')('abstract')(221,229)
- PsiElement(',')(',')(229,230)
- PsiWhiteSpace('\n ')(230,233)
- PsiTypeQLElement(type_constraint) - Location: (233,251)(233,251)
- PsiElement('owns')('owns')(233,237)
- PsiWhiteSpace(' ')(237,238)
- PsiTypeQLElement(type) - Location: (238,251)(238,251)
- PsiTypeQLElement(label) - Location: (238,251)(238,251)
- PsiElement(LABEL_)('approved-date')(238,251)
- PsiTypeQLElement(annotations_owns) - Location: (251,251)(251,251)
-
- PsiElement(',')(',')(251,252)
- PsiWhiteSpace('\n ')(252,255)
- PsiRelatesTypeConstraint(type_constraint) - Name: approved-subject - Location: (255,279)(255,279)
- PsiElement('relates')('relates')(255,262)
- PsiWhiteSpace(' ')(262,263)
- PsiTypeQLElement(type) - Location: (263,279)(263,279)
- PsiTypeQLElement(label) - Location: (263,279)(263,279)
- PsiElement(LABEL_)('approved-subject')(263,279)
- PsiElement(',')(',')(279,280)
- PsiWhiteSpace('\n ')(280,283)
- PsiRelatesTypeConstraint(type_constraint) - Name: requester - Location: (283,300)(283,300)
- PsiElement('relates')('relates')(283,290)
- PsiWhiteSpace(' ')(290,291)
- PsiTypeQLElement(type) - Location: (291,300)(291,300)
- PsiTypeQLElement(label) - Location: (291,300)(291,300)
- PsiElement(LABEL_)('requester')(291,300)
- PsiElement(',')(',')(300,301)
- PsiWhiteSpace('\n ')(301,304)
- PsiRelatesTypeConstraint(type_constraint) - Name: respondent - Location: (304,322)(304,322)
- PsiElement('relates')('relates')(304,311)
- PsiWhiteSpace(' ')(311,312)
- PsiTypeQLElement(type) - Location: (312,322)(312,322)
- PsiTypeQLElement(label) - Location: (312,322)(312,322)
- PsiElement(LABEL_)('respondent')(312,322)
- PsiElement(';')(';')(322,323)
- PsiWhiteSpace('\n\n')(323,325)
- PsiTypeQLElement(definable) - Location: (325,456)(325,456)
- PsiStatementType(variable_type) - Location: (325,456)(325,456)
- PsiTypeQLElement(type_any) - Location: (325,335)(325,335)
- PsiTypeConstraint(type) - Name: friendship - Location: (325,335)(325,335)
- PsiTypeQLElement(label) - Location: (325,335)(325,335)
- PsiElement(LABEL_)('friendship')(325,335)
- PsiWhiteSpace(' ')(335,336)
- PsiTypeQLElement(type_constraint) - Location: (336,348)(336,348)
- PsiElement(SUB_)('sub')(336,339)
- PsiWhiteSpace(' ')(339,340)
- PsiTypeQLElement(type_any) - Location: (340,348)(340,348)
- PsiTypeQLElement(type) - Location: (340,348)(340,348)
- PsiTypeQLElement(label) - Location: (340,348)(340,348)
- PsiTypeQLElement(type_native) - Location: (340,348)(340,348)
- PsiElement('relation')('relation')(340,348)
- PsiElement(',')(',')(348,349)
- PsiWhiteSpace('\n ')(349,354)
- PsiRelatesTypeConstraint(type_constraint) - Name: friend - Location: (354,368)(354,368)
- PsiElement('relates')('relates')(354,361)
- PsiWhiteSpace(' ')(361,362)
- PsiTypeQLElement(type) - Location: (362,368)(362,368)
- PsiTypeQLElement(label) - Location: (362,368)(362,368)
- PsiElement(LABEL_)('friend')(362,368)
- PsiElement(',')(',')(368,369)
- PsiWhiteSpace('\n ')(369,374)
- PsiPlaysTypeConstraint(type_constraint) - Location: (374,414)(374,414)
- PsiElement('plays')('plays')(374,379)
- PsiWhiteSpace(' ')(379,380)
- PsiTypeQLElement(type_scoped) - Location: (380,414)(380,414)
- PsiTypeQLElement(label_scoped) - Location: (380,414)(380,414)
- PsiElement(LABEL_SCOPED_)('friend-request:approved-friendship')(380,414)
- PsiElement(',')(',')(414,415)
- PsiWhiteSpace('\n ')(415,420)
- PsiPlaysTypeConstraint(type_constraint) - Location: (420,456)(420,456)
- PsiElement('plays')('plays')(420,425)
- PsiWhiteSpace(' ')(425,426)
- PsiTypeQLElement(type_scoped) - Location: (426,456)(426,456)
- PsiTypeQLElement(label_scoped) - Location: (426,456)(426,456)
- PsiElement(LABEL_SCOPED_)('friends-list:listed-friendship')(426,456)
- PsiElement(';')(';')(456,457)
- PsiWhiteSpace('\n\n')(457,459)
- PsiComment(COMMENT)('## an example of subtyping in TypeDB\n')(459,496)
- PsiTypeQLElement(definable) - Location: (496,671)(496,671)
- PsiStatementType(variable_type) - Location: (496,671)(496,671)
- PsiTypeQLElement(type_any) - Location: (496,510)(496,510)
- PsiTypeConstraint(type) - Name: friend-request - Location: (496,510)(496,510)
- PsiTypeQLElement(label) - Location: (496,510)(496,510)
- PsiElement(LABEL_)('friend-request')(496,510)
- PsiWhiteSpace(' ')(510,511)
- PsiSubTypeConstraint(type_constraint) - Location: (511,522)(511,522)
- PsiElement(SUB_)('sub')(511,514)
- PsiWhiteSpace(' ')(514,515)
- PsiTypeQLElement(type_any) - Location: (515,522)(515,522)
- PsiTypeQLElement(type) - Location: (515,522)(515,522)
- PsiTypeQLElement(label) - Location: (515,522)(515,522)
- PsiElement(LABEL_)('request')(515,522)
- PsiElement(',')(',')(522,523)
- PsiWhiteSpace('\n ')(523,528)
- PsiRelatesTypeConstraint(type_constraint) - Name: approved-friendship - Location: (528,555)(528,575)
- PsiElement('relates')('relates')(528,535)
- PsiWhiteSpace(' ')(535,536)
- PsiTypeQLElement(type) - Location: (536,555)(536,555)
- PsiTypeQLElement(label) - Location: (536,555)(536,555)
- PsiElement(LABEL_)('approved-friendship')(536,555)
- PsiWhiteSpace(' ')(555,556)
- PsiElement('as')('as')(556,558)
- PsiWhiteSpace(' ')(558,559)
- PsiRelatesSuperRoleTypeConstraint(type) - Location: (559,575)(559,575)
- PsiTypeQLElement(label) - Location: (559,575)(559,575)
- PsiElement(LABEL_)('approved-subject')(559,575)
- PsiElement(',')(',')(575,576)
- PsiWhiteSpace('\n ')(576,581)
- PsiRelatesTypeConstraint(type_constraint) - Name: friendship-requester - Location: (581,609)(581,622)
- PsiElement('relates')('relates')(581,588)
- PsiWhiteSpace(' ')(588,589)
- PsiTypeQLElement(type) - Location: (589,609)(589,609)
- PsiTypeQLElement(label) - Location: (589,609)(589,609)
- PsiElement(LABEL_)('friendship-requester')(589,609)
- PsiWhiteSpace(' ')(609,610)
- PsiElement('as')('as')(610,612)
- PsiWhiteSpace(' ')(612,613)
- PsiRelatesSuperRoleTypeConstraint(type) - Location: (613,622)(613,622)
- PsiTypeQLElement(label) - Location: (613,622)(613,622)
- PsiElement(LABEL_)('requester')(613,622)
- PsiElement(',')(',')(622,623)
- PsiWhiteSpace('\n ')(623,628)
- PsiRelatesTypeConstraint(type_constraint) - Name: friendship-respondent - Location: (628,657)(628,671)
- PsiElement('relates')('relates')(628,635)
- PsiWhiteSpace(' ')(635,636)
- PsiTypeQLElement(type) - Location: (636,657)(636,657)
- PsiTypeQLElement(label) - Location: (636,657)(636,657)
- PsiElement(LABEL_)('friendship-respondent')(636,657)
- PsiWhiteSpace(' ')(657,658)
- PsiElement('as')('as')(658,660)
- PsiWhiteSpace(' ')(660,661)
- PsiRelatesSuperRoleTypeConstraint(type) - Location: (661,671)(661,671)
- PsiTypeQLElement(label) - Location: (661,671)(661,671)
- PsiElement(LABEL_)('respondent')(661,671)
- PsiElement(';')(';')(671,672)
- PsiWhiteSpace('\n\n')(672,674)
- PsiTypeQLElement(definable) - Location: (674,770)(674,770)
- PsiStatementType(variable_type) - Location: (674,770)(674,770)
- PsiTypeQLElement(type_any) - Location: (674,686)(674,686)
- PsiTypeConstraint(type) - Name: friends-list - Location: (674,686)(674,686)
- PsiTypeQLElement(label) - Location: (674,686)(674,686)
- PsiElement(LABEL_)('friends-list')(674,686)
- PsiWhiteSpace(' ')(686,687)
- PsiTypeQLElement(type_constraint) - Location: (687,699)(687,699)
- PsiElement(SUB_)('sub')(687,690)
- PsiWhiteSpace(' ')(690,691)
- PsiTypeQLElement(type_any) - Location: (691,699)(691,699)
- PsiTypeQLElement(type) - Location: (691,699)(691,699)
- PsiTypeQLElement(label) - Location: (691,699)(691,699)
- PsiTypeQLElement(type_native) - Location: (691,699)(691,699)
- PsiElement('relation')('relation')(691,699)
- PsiElement(',')(',')(699,700)
- PsiWhiteSpace('\n ')(700,705)
- PsiTypeQLElement(type_constraint) - Location: (705,715)(705,715)
- PsiElement('owns')('owns')(705,709)
- PsiWhiteSpace(' ')(709,710)
- PsiTypeQLElement(type) - Location: (710,715)(710,715)
- PsiTypeQLElement(label) - Location: (710,715)(710,715)
- PsiElement(LABEL_)('title')(710,715)
- PsiTypeQLElement(annotations_owns) - Location: (715,715)(715,715)
-
- PsiElement(',')(',')(715,716)
- PsiWhiteSpace('\n ')(716,721)
- PsiRelatesTypeConstraint(type_constraint) - Name: list-owner - Location: (721,739)(721,739)
- PsiElement('relates')('relates')(721,728)
- PsiWhiteSpace(' ')(728,729)
- PsiTypeQLElement(type) - Location: (729,739)(729,739)
- PsiTypeQLElement(label) - Location: (729,739)(729,739)
- PsiElement(LABEL_)('list-owner')(729,739)
- PsiElement(',')(',')(739,740)
- PsiWhiteSpace('\n ')(740,745)
- PsiRelatesTypeConstraint(type_constraint) - Name: listed-friendship - Location: (745,770)(745,770)
- PsiElement('relates')('relates')(745,752)
- PsiWhiteSpace(' ')(752,753)
- PsiTypeQLElement(type) - Location: (753,770)(753,770)
- PsiTypeQLElement(label) - Location: (753,770)(753,770)
- PsiElement(LABEL_)('listed-friendship')(753,770)
- PsiElement(';')(';')(770,771)
- PsiWhiteSpace('\n\n')(771,773)
- PsiTypeQLElement(definable) - Location: (773,949)(773,949)
- PsiStatementType(variable_type) - Location: (773,949)(773,949)
- PsiTypeQLElement(type_any) - Location: (773,779)(773,779)
- PsiTypeConstraint(type) - Name: person - Location: (773,779)(773,779)
- PsiTypeQLElement(label) - Location: (773,779)(773,779)
- PsiElement(LABEL_)('person')(773,779)
- PsiWhiteSpace(' ')(779,780)
- PsiTypeQLElement(type_constraint) - Location: (780,790)(780,790)
- PsiElement(SUB_)('sub')(780,783)
- PsiWhiteSpace(' ')(783,784)
- PsiTypeQLElement(type_any) - Location: (784,790)(784,790)
- PsiTypeQLElement(type) - Location: (784,790)(784,790)
- PsiTypeQLElement(label) - Location: (784,790)(784,790)
- PsiTypeQLElement(type_native) - Location: (784,790)(784,790)
- PsiElement('entity')('entity')(784,790)
- PsiElement(',')(',')(790,791)
- PsiWhiteSpace('\n ')(791,796)
- PsiPlaysTypeConstraint(type_constraint) - Location: (796,819)(796,819)
- PsiElement('plays')('plays')(796,801)
- PsiWhiteSpace(' ')(801,802)
- PsiTypeQLElement(type_scoped) - Location: (802,819)(802,819)
- PsiTypeQLElement(label_scoped) - Location: (802,819)(802,819)
- PsiElement(LABEL_SCOPED_)('friendship:friend')(802,819)
- PsiElement(',')(',')(819,820)
- PsiWhiteSpace('\n ')(820,825)
- PsiPlaysTypeConstraint(type_constraint) - Location: (825,866)(825,866)
- PsiElement('plays')('plays')(825,830)
- PsiWhiteSpace(' ')(830,831)
- PsiTypeQLElement(type_scoped) - Location: (831,866)(831,866)
- PsiTypeQLElement(label_scoped) - Location: (831,866)(831,866)
- PsiElement(LABEL_SCOPED_)('friend-request:friendship-requester')(831,866)
- PsiElement(',')(',')(866,867)
- PsiWhiteSpace('\n ')(867,872)
- PsiPlaysTypeConstraint(type_constraint) - Location: (872,914)(872,914)
- PsiElement('plays')('plays')(872,877)
- PsiWhiteSpace(' ')(877,878)
- PsiTypeQLElement(type_scoped) - Location: (878,914)(878,914)
- PsiTypeQLElement(label_scoped) - Location: (878,914)(878,914)
- PsiElement(LABEL_SCOPED_)('friend-request:friendship-respondent')(878,914)
- PsiElement(',')(',')(914,915)
- PsiWhiteSpace('\n ')(915,920)
- PsiPlaysTypeConstraint(type_constraint) - Location: (920,949)(920,949)
- PsiElement('plays')('plays')(920,925)
- PsiWhiteSpace(' ')(925,926)
- PsiTypeQLElement(type_scoped) - Location: (926,949)(926,949)
- PsiTypeQLElement(label_scoped) - Location: (926,949)(926,949)
- PsiElement(LABEL_SCOPED_)('friends-list:list-owner')(926,949)
- PsiElement(';')(';')(949,950)
diff --git a/src/test/resources/parsing/correct_defines/ParsingTestData.tql b/src/test/resources/parsing/correct_defines/ParsingTestData.tql
new file mode 100644
index 0000000..ca090cc
--- /dev/null
+++ b/src/test/resources/parsing/correct_defines/ParsingTestData.tql
@@ -0,0 +1,1562 @@
+define
+
+# Based on https://docs.oasis-open.org/cti/stix/v2.1/cs01/stix-v2.1-cs01.html#-disnqa06jm5
+
+### 1 Base Entities ###
+
+stix-entity sub entity,
+ abstract;
+
+stix-object sub stix-entity,
+ owns stix-type,
+ owns stix-id @key,
+ owns custom-attribute,
+
+ plays granular-marking:marking;
+
+stix-core-object sub stix-object,
+ owns spec-version,
+
+ plays object-marking:marked,
+ plays created-by:created,
+ plays derivation:derived-from,
+ plays derivation:deriving,
+ plays duplicate-of:duplicated-object;
+
+
+stix-domain-object sub stix-core-object,
+ owns created,
+ owns modified,
+ owns revoked,
+ owns labels,
+ owns confidence,
+ owns langs,
+
+ # Rel
+ plays sighting:sighting-of,
+ plays external-references:referencing,
+
+ # RRel
+ plays kill-chain-phases:used,
+ plays sighting:observed-data,
+ plays external-references:referenced;
+
+
+stix-cyber-observable-object sub stix-core-object,
+ owns defanged,
+
+ # Rel
+ plays external-references:referencing,
+ plays contains-ref:containing,
+
+ # RRel
+ plays external-references:referenced;
+
+stix-sub-object sub stix-entity,
+ owns created,
+ owns modified,
+
+ plays granular-marking:marking;
+
+
+### 2 Data Types ###
+
+external-reference sub stix-sub-object,
+ owns source-name,
+ owns description,
+ owns url-link,
+ owns external-id,
+
+ plays hashes:hashes-owner,
+ plays external-references:referenced;
+
+kill-chain-phase sub stix-sub-object,
+ owns kill-chain-name,
+ owns kill-chain-phase-name,
+
+ plays kill-chain-phases:using;
+
+### 3 SDOs ###
+
+attack-pattern sub stix-domain-object,
+ owns name,
+ owns description,
+ owns aliases,
+
+ # Rel
+ plays delivers:delivering,
+ plays targets:targeting,
+ plays uses:using,
+
+ # RRel
+ plays indicates:indicated,
+ plays uses:used,
+ plays mitigates:mitigated;
+
+campaign sub stix-domain-object,
+ owns name,
+ owns description,
+ owns aliases,
+ owns first-seen,
+ owns last-seen,
+ owns objective,
+
+ # Rel
+ plays targets:targeting,
+ plays attributed-to:attributing,
+ plays uses:using,
+ plays compromises:compromising,
+ plays originates-from:originating,
+
+ # RRel
+ plays indicates:indicated;
+
+course-of-action sub stix-domain-object,
+ owns name,
+ owns description,
+ owns action,
+
+ # Rel
+ plays investigates:investigating,
+ plays mitigates:mitigating,
+ plays remediates:remediating;
+
+grouping sub stix-domain-object,
+ owns name,
+ owns description,
+ owns context;
+
+
+
+identity sub stix-domain-object,
+ owns name,
+ owns description,
+ owns stix-role,
+ owns identity-class,
+ owns sector,
+ owns contact-information,
+
+ plays created-by:creator,
+
+ # Rel
+ plays located-at:locating,
+ plays uses:using,
+
+ # RRel
+ plays uses:used,
+ plays targets:targeted,
+ plays attributed-to:attributed,
+ plays impersonates:impersonated;
+
+individual sub identity;
+group sub identity;
+system sub identity;
+organization sub identity;
+class sub identity;
+id-unknown sub identity;
+
+incident sub stix-domain-object,
+ owns name,
+ owns description;
+
+indicator sub stix-domain-object,
+ owns name,
+ owns description,
+ owns indicator-type,
+ owns pattern,
+ owns pattern-type,
+ owns pattern-version,
+ owns valid-from,
+ owns valid-until,
+
+ # Rel
+ plays indicates:indicating,
+ plays based-on:basing,
+
+ # RRel
+ plays investigates:investigated,
+ plays mitigates:mitigated;
+
+infrastructure sub stix-domain-object,
+ owns name,
+ owns description,
+ owns infrastructure-types,
+ owns aliases,
+ owns first-seen,
+ owns last-seen,
+
+ # Rel
+ plays delivers:delivering,
+ plays uses:using,
+ plays located-at:locating,
+ plays communicates-with:communicating,
+ plays consist-of:consisting,
+ plays controls:controlling,
+ plays have:having,
+ plays hosts:hosting,
+
+ # RRel
+ plays controls:controlled,
+ plays communicates-with:communicated,
+ plays compromises:compromised,
+ plays indicates:indicated,
+ plays uses:used,
+ plays targets:targeted,
+ plays hosts:hosted,
+ plays beacons-to:beaconed-to,
+ plays exfiltrates-to:exfiltrated-to,
+ plays ownerships:owned;
+
+intrusion-set sub stix-domain-object,
+ owns name,
+ owns description,
+ owns aliases,
+ owns first-seen,
+ owns last-seen,
+ owns goals,
+ owns sophistication,
+ owns resource-level,
+ owns primary-motivation,
+ owns secondary-motivations,
+
+ # Rel
+ plays targets:targeting,
+ plays uses:using,
+ plays attributed-to:attributing,
+ plays compromises:compromising,
+ plays originates-from:originating,
+ plays hosts:hosting,
+ plays ownerships:owning,
+
+ # RRel
+ plays indicates:indicated,
+ plays attributed-to:attributed,
+ plays authored-by:authored;
+
+malware sub stix-domain-object,
+ owns name,
+ owns description,
+ owns malware-types,
+ owns is-family,
+ owns aliases,
+ owns first-seen,
+ owns last-seen,
+ owns architecture-execution-envs,
+ owns implementation-languages,
+ owns capabilities,
+
+ # Rel
+ plays targets:targeting,
+ plays uses:using,
+ plays originates-from:originating,
+ plays controls:controlling,
+ plays hosts:hosting,
+ plays authored-by:authoring,
+ plays beacons-to:beaconing-to,
+ plays exfiltrates-to:exfiltrating-to,
+ plays downloads:downloading,
+ plays drops:dropping,
+ plays exploits:exploiting,
+ plays variant-of:varianted-from,
+ plays communicates-with:communicating,
+
+ # RRel
+ plays attributed-to:attributed,
+ plays controls:controlled,
+ plays remediates:remediated,
+ plays mitigates:mitigated,
+ plays uses:used,
+ plays delivers:delivered,
+ plays indicates:indicated,
+ plays downloads:downloaded,
+ plays drops:dropped,
+ plays variant-of:varianted,
+ plays characterizes:characterized,
+ plays analysis-of:analysed,
+ plays static-analysis-of:analysed,
+ plays dynamic-analysis-of:analysed;
+
+location sub stix-domain-object,
+ owns name,
+ owns description,
+ owns latitude,
+ owns longitude,
+ owns precision,
+ owns region,
+ owns country,
+ owns administrative-area,
+ owns city,
+ owns street-address,
+ owns postal-code,
+
+ # RRel
+ plays targets:targeted,
+ plays originates-from:originated,
+ plays located-at:located;
+
+malware-analysis sub stix-domain-object,
+ owns product,
+ owns version,
+ owns configuration-version,
+ owns module,
+ owns analysis-engine-version,
+ owns analysis-definition-version,
+ owns submitted,
+ owns analysis-started,
+ owns analysis-ended,
+ owns result-name,
+ owns result,
+
+ # Rel
+ plays characterizes:characterizing,
+ plays analysis-of:analysing,
+ plays static-analysis-of:analysing,
+ plays dynamic-analysis-of:analysing;
+
+note sub stix-domain-object,
+ owns note-abstract,
+ owns content,
+ owns authors;
+
+opinion sub stix-domain-object,
+ owns explanation,
+ owns authors,
+ owns opinion-enum;
+
+observed-data sub stix-domain-object,
+ owns first-observed,
+ owns last-observed,
+ owns number-observed,
+
+ # RRel
+ plays based-on:based,
+ plays consist-of:consisted;
+
+report sub stix-domain-object,
+ owns name,
+ owns description,
+ owns report-type,
+ owns published;
+
+threat-actor sub stix-domain-object,
+ owns name,
+ owns description,
+ owns aliases,
+ owns stix-role,
+ owns first-seen,
+ owns last-seen,
+ owns goals,
+ owns resource-level,
+ owns primary-motivation,
+ owns secondary-motivations,
+ owns sophistication,
+ owns personal-characteristics,
+ owns roles,
+ owns threat-actor-types,
+
+ # Rel
+ plays targets:targeting,
+ plays uses:using,
+ plays attributed-to:attributing,
+ plays compromises:compromising,
+ plays located-at:locating,
+ plays impersonates:impersonating,
+ plays hosts:hosting,
+ plays ownerships:owning,
+
+ # RRel
+ plays attributed-to:attributed,
+ plays indicates:indicated,
+ plays authored-by:authored;
+
+tool sub stix-domain-object,
+ owns name,
+ owns description,
+ owns tool-types,
+ owns aliases,
+ owns first-seen,
+ owns last-seen,
+ owns tool-version,
+
+ # Rel
+ plays delivers:delivering,
+ plays targets:targeting,
+ plays uses:using,
+ plays have:having,
+ plays drops:dropping,
+
+ # RRel
+ plays uses:used,
+ plays indicates:indicated,
+ plays mitigates:mitigated,
+ plays hosts:hosted,
+ plays downloads:downloaded,
+ plays drops:dropped;
+
+custom-object sub stix-domain-object,
+ owns name,
+ owns description,
+ owns aliases,
+ owns first-seen,
+ owns last-seen,
+ owns objective,
+
+ # Rel
+ plays delivers:delivering,
+ plays targets:targeting,
+ plays uses:using,
+
+ # RRel
+ plays uses:used,
+ plays mitigates:mitigated;
+
+vulnerability sub stix-domain-object,
+ owns name,
+ owns description,
+
+ # RRel
+ plays targets:targeted,
+ plays mitigates:mitigated,
+ plays remediates:remediated,
+ plays have:had,
+ plays exploits:exploited;
+
+### 5 SROs ###
+stix-core-relationship sub relation,
+ # Required
+ owns spec-version,
+ owns stix-id @key,
+ owns created,
+ owns modified,
+ owns stix-type,
+
+ # Optional
+ owns description,
+ owns revoked,
+ owns labels,
+ owns confidence,
+ owns langs,
+ owns custom-attribute,
+
+ relates source,
+ relates target,
+
+ plays created-by:created,
+ plays granular-marking:marking,
+ plays external-references:referenced;
+
+delivers sub stix-core-relationship,
+ relates delivering as source,
+ relates delivered as target;
+
+targets sub stix-core-relationship,
+ relates targeting as source,
+ relates targeted as target;
+
+attributed-to sub stix-core-relationship,
+ relates attributing as source,
+ relates attributed as target;
+
+uses sub stix-core-relationship,
+ relates using as source,
+ relates used as target;
+
+indicates sub stix-core-relationship,
+ relates indicating as source,
+ relates indicated as target;
+
+compromises sub stix-core-relationship,
+ relates compromising as source,
+ relates compromised as target;
+
+originates-from sub stix-core-relationship,
+ relates originating as source,
+ relates originated as target;
+
+investigates sub stix-core-relationship,
+ relates investigating as source,
+ relates investigated as target;
+
+mitigates sub stix-core-relationship,
+ relates mitigating as source,
+ relates mitigated as target;
+
+remediates sub stix-core-relationship,
+ relates remediating as source,
+ relates remediated as target;
+
+located-at sub stix-core-relationship,
+ relates locating as source,
+ relates located as target;
+
+impersonates sub stix-core-relationship,
+ relates impersonating as source,
+ relates impersonated as target;
+
+based-on sub stix-core-relationship,
+ relates basing as source,
+ relates based as target;
+
+communicates-with sub stix-core-relationship,
+ relates communicating as source,
+ relates communicated as target;
+
+consist-of sub stix-core-relationship,
+ relates consisting as source,
+ relates consisted as target;
+
+controls sub stix-core-relationship,
+ relates controlling as source,
+ relates controlled as target;
+
+have sub stix-core-relationship,
+ relates having as source,
+ relates had as target;
+
+hosts sub stix-core-relationship,
+ relates hosting as source,
+ relates hosted as target;
+
+authored-by sub stix-core-relationship,
+ relates authoring as source,
+ relates authored as target;
+
+beacons-to sub stix-core-relationship,
+ relates beaconing-to as source,
+ relates beaconed-to as target;
+
+exfiltrates-to sub stix-core-relationship,
+ relates exfiltrating-to as source,
+ relates exfiltrated-to as target;
+
+downloads sub stix-core-relationship,
+ relates downloading as source,
+ relates downloaded as target;
+
+drops sub stix-core-relationship,
+ relates dropping as source,
+ relates dropped as target;
+
+exploits sub stix-core-relationship,
+ relates exploiting as source,
+ relates exploited as target;
+
+variant-of sub stix-core-relationship,
+ relates varianted-from as source,
+ relates varianted as target;
+
+characterizes sub stix-core-relationship,
+ relates characterizing as source,
+ relates characterized as target;
+
+analysis sub stix-core-relationship,
+ relates analysing as source,
+ relates analysed as target;
+
+analysis-of sub analysis;
+static-analysis-of sub analysis;
+dynamic-analysis-of sub analysis;
+
+ownerships sub stix-core-relationship,
+ relates owning as source,
+ relates owned as target;
+
+ref sub relation,
+ relates source,
+ relates target;
+
+from-ref sub ref;
+sender-ref sub ref;
+raw-email-ref sub ref;
+body-raw-ref sub ref;
+parent-directory-ref sub ref;
+content-ref sub ref;
+optional-header sub ref,
+ relates from as source;
+belongs-to-ref sub ref;
+src-ref sub ref;
+dst-ref sub ref;
+src-payload-ref sub ref;
+dst-payload-ref sub ref;
+encapsulated-by-ref sub ref;
+massage-body-data-ref sub ref;
+creator-user-ref sub ref;
+image-ref sub ref;
+parent-ref sub ref;
+message-body-data-ref sub ref,
+ relates from as source;
+
+derivation sub relation,
+ relates derived-from,
+ relates deriving;
+
+duplicate-of sub relation,
+ relates duplicated-object;
+
+
+sighting sub stix-core-relationship,
+ owns first-seen,
+ owns last-seen,
+ owns count,
+ owns summary,
+
+ relates sighting-of,
+ relates observed-data;
+
+
+
+### 6 SCOs ###
+
+artifact sub stix-cyber-observable-object,
+ owns mime-type,
+ owns payload-bin,
+ owns url-link,
+ owns encryption-algorithm,
+ owns decryption-key,
+
+ # RRel
+ plays body-raw-ref:target,
+ plays raw-email-ref:target,
+ plays content-ref:target,
+ plays message-body-data-ref:target;
+
+autonomous-system sub stix-cyber-observable-object,
+ owns number,
+ owns name,
+ owns rir,
+
+ # RRel
+ plays belongs-to-refs:belonging;
+
+directory sub stix-cyber-observable-object,
+ owns path,
+ owns path-enc,
+ owns ctime,
+ owns mtime,
+ owns atime,
+
+ # Rel
+ plays contains-ref:contained,
+
+ # RRel
+ plays parent-directory-ref:target;
+
+domain-name sub stix-cyber-observable-object,
+ owns stix-value,
+
+ # Rel
+ plays resolves-to-refs:resolved,
+
+ # RRel
+ plays resolves-to-refs:resolving,
+ plays communicates-with:communicated;
+
+
+email-addr sub stix-cyber-observable-object,
+ owns stix-value,
+ owns display-name,
+
+ # Rel
+ plays belongs-to-ref:source,
+
+ # RRel
+ plays from-ref:target,
+ plays sender-ref:target,
+ plays to-refs:to,
+ plays cc-refs:to,
+ plays bcc-refs:to;
+
+email-message sub stix-cyber-observable-object,
+ owns is-multipart,
+ owns date,
+ owns content-type,
+ owns message-id,
+ owns subject,
+ owns body,
+
+ # Rel
+ plays from-ref:source,
+ plays sender-ref:source,
+ plays to-refs:from,
+ plays cc-refs:from,
+ plays bcc-refs:from,
+ plays received-lines:owner,
+ plays body-multipart:to,
+ plays raw-email-ref:source;
+
+
+email-mime-part sub stix-sub-object,
+ owns body,
+ owns content-type,
+ owns content-disposition,
+
+ # Rel
+ plays body-raw-ref:source,
+
+ # RRel
+ plays body-multipart:from;
+
+file sub stix-cyber-observable-object,
+ owns size,
+ owns name,
+ owns name-enc,
+ owns magic-number-hex,
+ owns mime-type,
+ owns ctime,
+ owns mtime,
+ owns atime,
+
+ # Rel
+ plays hashes:hashes-owner,
+ plays parent-directory-ref:source,
+ plays contains-ref:contained,
+ plays content-ref:source,
+
+ # RRel
+ plays downloads:downloaded,
+ plays body-raw-ref:target,
+ plays image-ref:target,
+ plays service-dll-refs:to;
+
+archive-ext sub file,
+ owns comment;
+
+ntfs-ext sub file,
+ owns sid,
+
+ # Rel
+ plays alternate-data-streams:from;
+
+alternate-data-stream sub file,
+
+ # RRel
+ plays alternate-data-streams:to;
+
+pdf-ext sub stix-cyber-observable-object,
+ owns version,
+ owns is-optimized,
+ owns pdfid0,
+ owns pdfid1,
+
+ # Rel
+ plays document-info-dict:document-owner;
+
+raster-image-ext sub file,
+ owns image-height,
+ owns image-width,
+ owns bits-per-pixel,
+
+ # Rel
+ plays exif-tags:exif-owner;
+
+windows-pebinary-ext sub file,
+ owns pe-type,
+ owns imphash,
+ owns machine-hex,
+ owns number-of-sections,
+ owns time-date-stamp,
+ owns pointer-to-symbol-table-hex,
+ owns number-of-symbols,
+ owns size-of-optional-header,
+ owns characterstics-hex,
+
+ # Rel
+ plays optional-header:from,
+ plays sections:from;
+
+windows-pe-optional-header-type sub entity,
+ owns magic-hex,
+ owns major-linker-version,
+ owns minor-linker-version,
+ owns size-of-code,
+ owns size-of-initialized-data,
+ owns size-ofuninitialized-data,
+ owns address-of-entry-point,
+ owns base-of-code,
+ owns base-of-data,
+ owns image-base,
+ owns section-alignment,
+ owns file-alignment,
+ owns major-os-version,
+ owns minor-os-version,
+ owns major-image-version,
+ owns minor-image-version,
+ owns major-subsystem-version,
+ owns minor-subsystem-version,
+ owns win32-version-value-hex,
+ owns size-of-image,
+ owns size-of-headers,
+ owns checksum-hex,
+ owns subsystem-hex,
+ owns dll-characteristics-hex,
+ owns size-of-stack-reserve,
+ owns size-of-stack-commit,
+ owns size-of-heap-reserve,
+ owns size-of-heap-commit,
+ owns loader-flags-hex,
+ owns number-of-rva-and-sizes,
+
+ # Rel
+ plays hashes:hashes-owner,
+
+ # RRel
+ plays optional-header:target;
+
+windows-pe-section sub entity,
+ owns name,
+ owns size,
+ owns entropy,
+
+ # Rel
+ plays hashes:hashes-owner,
+
+ # RRel
+ plays sections:to;
+
+ipv4-address sub stix-cyber-observable-object,
+ owns stix-value,
+
+ # Rel
+ plays resolves-to-refs:resolved,
+ plays belongs-to-refs:belonged,
+
+ # RRel
+ plays resolves-to-refs:resolving,
+ plays communicates-with:communicated;
+
+
+
+ipv6-address sub stix-cyber-observable-object,
+ owns stix-value,
+
+ # Rel
+ plays resolves-to-refs:resolved,
+ plays belongs-to-refs:belonged,
+
+ # RRel
+ plays resolves-to-refs:resolving,
+ plays communicates-with:communicated;
+
+
+mac-addr sub stix-cyber-observable-object,
+ owns stix-value,
+
+ # RRel
+ plays resolves-to-refs:resolving;
+
+
+mutex sub stix-cyber-observable-object,
+ owns name;
+
+
+network-traffic sub stix-cyber-observable-object,
+ owns start,
+ owns end,
+ owns is-active,
+ owns src-port,
+ owns dst-port,
+
+ # Rel
+ plays src-ref:source,
+ plays dst-ref:source,
+ plays src-payload-ref:source,
+ plays dst-payload-ref:source,
+ plays encapsulated-by-ref:source,
+ plays protocols:from,
+ plays ipfix:ipfix-owner,
+ plays encapsulates-refs:encapsulated,
+
+ # RRel
+ plays encapsulates-refs:encapsulating,
+ plays encapsulated-by-ref:target,
+ plays opened-connection-refs:opening;
+
+http-request-ext sub network-traffic,
+ owns request-method,
+ owns request-value,
+ owns request-version,
+ owns message-body-length,
+
+ # Rel
+ plays request-header:header-owner,
+ plays message-body-data-ref:from;
+
+icmp-ext sub network-traffic,
+ owns icmp-type-hex,
+ owns icmp-code-hex;
+
+socket-ext sub network-traffic,
+ owns address-family,
+ owns is-blocking,
+ owns is-listening,
+ owns socket-type,
+ owns socket-descriptor,
+ owns socket-handle,
+
+ # Rel
+ plays options:options-owner;
+
+tcp-ext sub network-traffic,
+ owns src-flags-hex,
+ owns dst-flags-hex;
+
+process sub stix-cyber-observable-object,
+ owns is-hidden,
+ owns pid,
+ owns created-time,
+ owns cwd,
+ owns command-line,
+
+ # Rel
+ plays environment-variables:variables-owner,
+ plays opened-connection-refs:opened,
+ plays creator-user-ref:source,
+ plays image-ref:source,
+ plays parent-ref:source,
+ plays child-refs:parent,
+
+ # RRel
+ plays parent-ref:target,
+ plays child-refs:child;
+
+windows-process-ext sub process,
+ owns aslr-enabled,
+ owns dep-enabled,
+ owns priority,
+ owns owner-sid,
+ owns window-title,
+ owns integrity-level,
+
+ # Rel
+ plays startup-info:info-owner as owner;
+
+windows-service-ext sub process,
+ owns service-name,
+ owns display-name,
+ owns group-name,
+ owns start-type,
+ owns service-type,
+ owns service-status,
+ owns descriptions,
+
+ # Rel
+ plays service-dll-refs:from;
+
+software sub stix-cyber-observable-object,
+ owns name,
+ owns spe,
+ owns swid,
+ owns vendor,
+ owns version,
+ owns languages;
+
+url sub stix-cyber-observable-object,
+ owns stix-value,
+
+ # RRel
+ plays communicates-with:communicated;
+
+
+user-account sub stix-cyber-observable-object,
+ owns user-id,
+ owns credential,
+ owns account-login,
+ owns account-type,
+ owns display-name,
+ owns is-service-account,
+ owns is-privileged,
+ owns can-escalate-privs,
+ owns is-disabled,
+ owns account-created,
+ owns account-expires,
+ owns credential-last-changed,
+ owns account-first-login,
+ owns account-last-login,
+
+ # RRel
+ plays belongs-to-ref:target,
+ plays creator-user-ref:target;
+
+unix-account-ext sub user-account,
+ owns gid,
+ owns home-dir,
+ owns shell,
+ owns groups;
+
+
+windows-registry-key sub stix-cyber-observable-object,
+ owns attribute-key,
+ owns modified-time,
+ owns number-subkeys,
+
+ # Rel
+ plays values:from,
+ plays creator-user-ref:source;
+
+windows-registry-value-type sub stix-cyber-observable-object,
+ owns name,
+ owns data,
+ owns data-type,
+
+ # RRel
+ plays values:to;
+
+x509-certificate sub stix-cyber-observable-object,
+ owns is-self-signed,
+ owns version,
+ owns serial-number,
+ owns signature-algorithm,
+ owns issuer,
+ owns validity-not-before,
+ owns validity-not-after,
+ owns subject,
+ owns subject-public-key-algorithm,
+ owns subject-public-key-modulus,
+ owns subject-public-key-exponent,
+
+ # Rel
+ plays hashes:hashes-owner;
+
+x509-v3-extensions sub x509-certificate,
+ owns basic-constraints,
+ owns name-constraints,
+ owns policy-constraints,
+ owns key-usage,
+ owns extended-key-usage,
+ owns subject-key-identifier,
+ owns authority-key-identifier,
+ owns subject-alternative-name,
+ owns issuer-alternative-name,
+ owns subject-directory-attributes,
+ owns crl-distribution-points,
+ owns inhibit-any-policy,
+ owns private-key-usage-period-not-before,
+ owns private-key-usage-period-not-after,
+ owns certificate-policies,
+ owns policy-mappings;
+
+marking-definition sub stix-object,
+ owns created,
+ owns modified,
+ owns name,
+ owns spec-version,
+
+ plays created-by:created,
+ plays data-marking:marking,
+ plays external-references:referencing;
+
+statement-marking sub marking-definition,
+ owns statement;
+
+tlp-marking sub marking-definition,
+ owns color;
+
+list sub relation,
+ relates list-item,
+ relates owner;
+
+linked-list sub list,
+ plays first-element:list,
+ plays last-element:list,
+ plays list-element:list;
+
+first-element sub relation,
+ relates first,
+ relates list;
+
+last-element sub relation,
+ relates last,
+ relates list;
+
+list-element sub relation,
+ relates element,
+ relates list;
+
+node sub relation,
+ relates next,
+ relates listed,
+
+ # Rel
+ plays node:next,
+
+ # RRel
+ plays list-element:element,
+ plays last-element:last,
+ plays first-element:first;
+
+dict sub relation,
+ relates dict-item,
+ relates owner,
+ owns key-abstract,
+ abstract;
+
+
+hashes sub dict,
+ relates hash-value as dict-item,
+ relates hashes-owner as owner,
+ owns hash-algorithm as key-abstract;
+
+document-info-dict sub dict,
+ relates document-info as dict-item,
+ relates document-owner as owner,
+ owns key as key-abstract;
+
+exif-tags sub dict,
+ relates exif-tag as dict-item,
+ relates exif-owner as owner,
+ owns key as key-abstract;
+
+ipfix sub dict,
+ relates ipfix-field as dict-item,
+ relates ipfix-owner as owner,
+ owns key as key-abstract;
+
+request-header sub dict,
+ relates header as dict-item,
+ relates header-owner as owner,
+ owns key as key-abstract;
+
+options sub dict,
+ relates option as dict-item,
+ relates options-owner as owner,
+ owns key as key-abstract;
+
+environment-variables sub dict,
+ relates variable as dict-item,
+ relates variables-owner as owner,
+ owns key as key-abstract;
+
+startup-info sub dict,
+ relates info as dict-item,
+ relates info-owner as owner,
+ owns key as key-abstract;
+
+additional-header-fields sub relation,
+ relates dict-item,
+ relates owner,
+
+ plays header-fields:owner,
+
+ owns key;
+
+header-fields sub list,
+ plays additional-header-fields:dict-item;
+
+external-references sub list,
+ relates referencing as list-item,
+ relates referenced as owner;
+
+kill-chain-phases sub list,
+ relates using as list-item,
+ relates used as owner;
+
+data-marking sub list,
+ relates marking as list-item,
+ relates marked as owner,
+
+ plays granular-marking:marking;
+
+object-marking sub list,
+ relates marking as list-item,
+ relates marked as owner;
+
+granular-marking sub list,
+ relates marking as list-item,
+ relates marked as owner;
+
+created-by sub list,
+ relates creator as list-item,
+ relates created as owner;
+
+resolves-to-refs sub list,
+ relates resolving as list-item,
+ relates resolved as owner;
+
+belongs-to-refs sub list,
+ relates belonging as list-item,
+ relates belonged as owner;
+
+contains-ref sub list,
+ relates containing as list-item,
+ relates contained as owner;
+
+to-refs sub list,
+ relates to as list-item,
+ relates from as owner;
+
+cc-refs sub list,
+ relates to as list-item,
+ relates from as owner;
+
+bcc-refs sub list,
+ relates to as list-item,
+ relates from as owner;
+
+body-multipart sub list,
+ relates to as list-item,
+ relates from as owner;
+
+alternate-data-streams sub list,
+ relates to as list-item,
+ relates from as owner;
+
+sections sub list,
+ relates to as list-item,
+ relates from as owner;
+
+protocols sub list,
+ relates to as list-item,
+ relates from as owner;
+
+encapsulates-refs sub list,
+ relates encapsulating as list-item,
+ relates encapsulated as owner;
+
+opened-connection-refs sub list,
+ relates opening as list-item,
+ relates opened as owner;
+
+child-refs sub list,
+ relates child as list-item,
+ relates parent as owner;
+
+service-dll-refs sub list,
+ relates to as list-item,
+ relates from as owner;
+
+
+values sub list,
+ relates to as list-item,
+ relates from as owner;
+
+received-lines sub linked-list;
+
+stix-attribute-string sub attribute,
+ value string,
+
+ plays granular-marking:marking,
+ abstract;
+
+
+stix-type sub stix-attribute-string;
+stix-id sub stix-attribute-string;
+stix-role sub stix-attribute-string;
+spec-version sub stix-attribute-string;
+labels sub stix-attribute-string;
+langs sub stix-attribute-string;
+defanged sub stix-attribute-string;
+source-name sub stix-attribute-string;
+url-link sub stix-attribute-string;
+external-id sub stix-attribute-string;
+name sub stix-attribute-string;
+name-enc sub stix-attribute-string;
+magic-number-hex sub stix-attribute-string;
+mime-type sub stix-attribute-string;
+aliases sub stix-attribute-string;
+objective sub stix-attribute-string;
+action sub stix-attribute-string;
+context sub stix-attribute-string;
+identity-class sub stix-attribute-string;
+sector sub stix-attribute-string;
+infrastructure-types sub stix-attribute-string;
+contact-information sub stix-attribute-string;
+indicator-type sub stix-attribute-string;
+pattern sub stix-attribute-string;
+pattern-type sub stix-attribute-string;
+pattern-version sub stix-attribute-string;
+goals sub stix-attribute-string;
+resource-level sub stix-attribute-string;
+primary-motivation sub stix-attribute-string;
+secondary-motivations sub stix-attribute-string;
+malware-types sub stix-attribute-string;
+architecture-execution-envs sub stix-attribute-string;
+implementation-languages sub stix-attribute-string;
+capabilities sub stix-attribute-string;
+region sub stix-attribute-string;
+country sub stix-attribute-string;
+administrative-area sub stix-attribute-string;
+city sub stix-attribute-string;
+street-address sub stix-attribute-string;
+postal-code sub stix-attribute-string;
+version sub stix-attribute-string;
+configuration-version sub stix-attribute-string;
+module sub stix-attribute-string;
+analysis-engine-version sub stix-attribute-string;
+analysis-definition-version sub stix-attribute-string;
+result-name sub stix-attribute-string;
+result sub stix-attribute-string;
+note-abstract sub stix-attribute-string;
+content sub stix-attribute-string;
+authors sub stix-attribute-string;
+explanation sub stix-attribute-string;
+opinion-enum sub stix-attribute-string;
+report-type sub stix-attribute-string;
+sophistication sub stix-attribute-string;
+personal-characteristics sub stix-attribute-string;
+roles sub stix-attribute-string;
+threat-actor-types sub stix-attribute-string;
+tool-types sub stix-attribute-string;
+tool-version sub stix-attribute-string;
+vulnerability-types sub stix-attribute-string;
+kill-chain-name sub stix-attribute-string;
+kill-chain-phase-name sub stix-attribute-string;
+summary sub stix-attribute-string;
+payload-bin sub stix-attribute-string;
+decryption-key sub stix-attribute-string;
+path sub stix-attribute-string;
+path-enc sub stix-attribute-string;
+rir sub stix-attribute-string;
+display-name sub stix-attribute-string;
+content-type sub stix-attribute-string;
+message-id sub stix-attribute-string;
+subject sub stix-attribute-string;
+body sub stix-attribute-string;
+content-disposition sub stix-attribute-string;
+comment sub stix-attribute-string;
+sid sub stix-attribute-string;
+owner-sid sub stix-attribute-string;
+pdfid0 sub stix-attribute-string;
+pdfid1 sub stix-attribute-string;
+pe-type sub stix-attribute-string;
+imphash sub stix-attribute-string;
+machine-hex sub stix-attribute-string;
+pointer-to-symbol-table-hex sub stix-attribute-string;
+characterstics-hex sub stix-attribute-string;
+win32-version-value-hex sub stix-attribute-string;
+checksum-hex sub stix-attribute-string;
+subsystem-hex sub stix-attribute-string;
+dll-characteristics-hex sub stix-attribute-string;
+loader-flags-hex sub stix-attribute-string;
+magic-hex sub stix-attribute-string;
+request-method sub stix-attribute-string;
+request-value sub stix-attribute-string;
+request-version sub stix-attribute-string;
+icmp-type-hex sub stix-attribute-string;
+icmp-code-hex sub stix-attribute-string;
+service-name sub stix-attribute-string;
+subject-public-key-algorithm sub stix-attribute-string;
+subject-public-key-modulus sub stix-attribute-string;
+certificate-policies sub stix-attribute-string;
+crl-distribution-points sub stix-attribute-string;
+subject-directory-attributes sub stix-attribute-string;
+key-usage sub stix-attribute-string;
+subject-alternative-name sub stix-attribute-string;
+subject-key-identifier sub stix-attribute-string;
+extended-key-usage sub stix-attribute-string;
+name-constraints sub stix-attribute-string;
+policy-mappings sub stix-attribute-string;
+policy-constraints sub stix-attribute-string;
+basic-constraints sub stix-attribute-string;
+inhibit-any-policy sub stix-attribute-string;
+authority-key-identifier sub stix-attribute-string;
+issuer-alternative-name sub stix-attribute-string;
+data sub stix-attribute-string;
+user-id sub stix-attribute-string;
+priority sub stix-attribute-string;
+stix-value sub stix-attribute-string;
+cwd sub stix-attribute-string;
+command-line sub stix-attribute-string;
+account-login sub stix-attribute-string;
+group-name sub stix-attribute-string;
+dst-flags-hex sub stix-attribute-string;
+src-flags-hex sub stix-attribute-string;
+product sub stix-attribute-string;
+spe sub stix-attribute-string;
+exif-tag-string sub stix-attribute-string;
+window-title sub stix-attribute-string;
+statement sub stix-attribute-string;
+home-dir sub stix-attribute-string;
+account-type sub stix-attribute-string;
+credential sub stix-attribute-string;
+attribute-key sub stix-attribute-string;
+shell sub stix-attribute-string;
+swid sub stix-attribute-string;
+vendor sub stix-attribute-string;
+description sub stix-attribute-string;
+descriptions sub stix-attribute-string;
+languages sub stix-attribute-string;
+groups sub stix-attribute-string;
+
+received sub stix-attribute-string,
+ plays node:listed;
+document-info sub stix-attribute-string,
+ plays document-info-dict:document-info;
+protocol sub stix-attribute-string,
+ plays protocols:to;
+ipfix-string sub stix-attribute-string,
+ plays ipfix:ipfix-field;
+header sub stix-attribute-string,
+ plays request-header:header;
+environment-variable sub stix-attribute-string,
+ plays environment-variables:variable;
+startup sub stix-attribute-string,
+ plays startup-info:info;
+
+issuer sub stix-attribute-string;
+serial-number sub stix-attribute-string;
+signature-algorithm sub stix-attribute-string;
+subject-public-key-exponent sub stix-attribute-string;
+
+hash-value sub stix-attribute-string,
+ plays hashes:hash-value;
+key-abstract sub stix-attribute-string,
+ abstract;
+key sub key-abstract;
+hash-algorithm sub key-abstract,
+ regex "^(MD5|SHA-1|SHA-256|SHA-512|SHA3-256|SHA3-512|SSDEEP|TLSH)$";
+encryption-algorithm sub stix-attribute-string,
+ regex "^(AES-256-GCM|ChaCha20-Poly1305|mime-type-indicated)$";
+address-family sub stix-attribute-string,
+ regex "^(AF-UNSPEC|AF-INET|AF-IPX|AF-APPLETALK|AF-NETBIOS|AF-INET6|AF-IRDA|AF-BTH)$";
+socket-type sub stix-attribute-string,
+ regex "^(SOCK-STREAM|SOCK-DGRAM|SOCK-RAW|SOCK-RDM|SOCK-SEQPACKET)$";
+opinion-enum sub stix-attribute-string,
+ regex "^(strongly-disagree|disagree|neutral|agree|strongly-agree)$";
+integrity-level sub stix-attribute-string,
+ regex "^(low|medium|high|system)$";
+data-type sub stix-attribute-string,
+ regex "^(REG-NONE|REG-SZ|REG-EXPAND-SZ|REG-BINARY|REG-DWORD|REG-DWORD-BIG-ENDIAN|REG-LINK|REG-MULTI-SZ|REG-RESOURCE-LIST|REG-FULL-RESOURCE-DESCRIPTION|REG-RESOURCE-REQUIREMENTS-LIST|REG-QWORD|REG-INVALID-TYPE)$";
+start-type sub stix-attribute-string,
+ regex "^(SERVICE-AUTO-START|SERVICE-BOOT-START|SERVICE-DEMAND-START|SERVICE-DISABLED|SERVICE-SYSTEM-ALERT)$";
+service-type sub stix-attribute-string,
+ regex "^(SERVICE-KERNEL-DRIVER|SERVICE-FILE-SYSTEM-DRIVER|SERVICE-WIN32-OWN-PROCESS|SERVICE-WIN32-SHARE-PROCESS)$";
+service-status sub stix-attribute-string,
+ regex "^(SERVICE-CONTINUE-PENDING|SERVICE-PAUSE-PENDING|SERVICE-PAUSED|SERVICE-RUNNING|SERVICE-START-PENDING|SERVICE-STOP-PENDING|SERVICE-STOPPED)$";
+color sub stix-attribute-string,
+ regex "^(white|green|amber|red|clear)$";
+stix-attribute-double sub attribute,
+ value double,
+
+ plays granular-marking:marked,
+ abstract;
+
+number sub stix-attribute-double;
+latitude sub stix-attribute-double;
+longitude sub stix-attribute-double;
+precision sub stix-attribute-double;
+number-observed sub stix-attribute-double;
+count sub stix-attribute-double;
+entropy sub stix-attribute-double;
+size-ofuninitialized-data sub stix-attribute-double;
+
+stix-attribute-integer sub attribute,
+ value long,
+
+ plays granular-marking:marked,
+ abstract;
+
+size sub stix-attribute-integer;
+gid sub stix-attribute-integer;
+image-height sub stix-attribute-integer;
+image-width sub stix-attribute-integer;
+bits-per-pixel sub stix-attribute-integer;
+confidence sub stix-attribute-integer;
+number-of-sections sub stix-attribute-integer;
+number-of-symbols sub stix-attribute-integer;
+size-of-optional-header sub stix-attribute-integer;
+major-linker-version sub stix-attribute-integer;
+minor-linker-version sub stix-attribute-integer;
+size-of-code sub stix-attribute-integer;
+size-of-initialized-data sub stix-attribute-integer;
+size-of-uninitialized-data sub stix-attribute-integer;
+address-of-entry-point sub stix-attribute-integer;
+base-of-code sub stix-attribute-integer;
+base-of-data sub stix-attribute-integer;
+image-base sub stix-attribute-integer;
+section-alignment sub stix-attribute-integer;
+file-alignment sub stix-attribute-integer;
+major-os-version sub stix-attribute-integer;
+minor-os-version sub stix-attribute-integer;
+major-image-version sub stix-attribute-integer;
+minor-image-version sub stix-attribute-integer;
+major-subsystem-version sub stix-attribute-integer;
+minor-subsystem-version sub stix-attribute-integer;
+size-of-image sub stix-attribute-integer;
+size-of-headers sub stix-attribute-integer;
+size-of-stack-reserve sub stix-attribute-integer;
+size-of-stack-commit sub stix-attribute-integer;
+size-of-heap-reserve sub stix-attribute-integer;
+size-of-heap-commit sub stix-attribute-integer;
+number-of-rva-and-sizes sub stix-attribute-integer;
+message-body-length sub stix-attribute-integer;
+number-subkeys sub stix-attribute-integer;
+exif-tag-int sub stix-attribute-integer;
+src-port sub stix-attribute-integer;
+dst-port sub stix-attribute-integer;
+src-byte-count sub stix-attribute-integer;
+dst-byte-count sub stix-attribute-integer;
+src-packets sub stix-attribute-integer;
+dst-packets sub stix-attribute-integer;
+socket-descriptor sub stix-attribute-integer;
+socket-handle sub stix-attribute-integer;
+pid sub stix-attribute-integer;
+option sub stix-attribute-integer,
+ plays options:option;
+ipfix-integer sub stix-attribute-integer,
+ plays ipfix:ipfix-field;
+
+stix-attribute-boolean sub attribute,
+ value boolean,
+
+ plays granular-marking:marked,
+ abstract;
+
+is-family sub stix-attribute-boolean;
+is-optimized sub stix-attribute-boolean;
+is-self-signed sub stix-attribute-boolean;
+dep-enabled sub stix-attribute-boolean;
+is-active sub stix-attribute-boolean;
+is-hidden sub stix-attribute-boolean;
+is-blocking sub stix-attribute-boolean;
+is-listening sub stix-attribute-boolean;
+can-escalate-privs sub stix-attribute-boolean;
+is-service-account sub stix-attribute-boolean;
+is-privileged sub stix-attribute-boolean;
+can-escalate-privs sub stix-attribute-boolean;
+is-disabled sub stix-attribute-boolean;
+is-multipart sub stix-attribute-boolean;
+aslr-enabled sub stix-attribute-boolean;
+revoked sub stix-attribute-boolean;
+
+stix-attribute-timestamp sub attribute,
+ value datetime,
+
+ plays granular-marking:marked,
+ abstract;
+
+date sub stix-attribute-timestamp;
+ctime sub stix-attribute-timestamp;
+atime sub stix-attribute-timestamp;
+mtime sub stix-attribute-timestamp;
+created sub stix-attribute-timestamp;
+modified sub stix-attribute-timestamp;
+submitted sub stix-attribute-timestamp;
+valid-from sub stix-attribute-timestamp;
+valid-until sub stix-attribute-timestamp;
+first-observed sub stix-attribute-timestamp;
+last-observed sub stix-attribute-timestamp;
+analysis-started sub stix-attribute-timestamp;
+analysis-ended sub stix-attribute-timestamp;
+published sub stix-attribute-timestamp;
+first-seen sub stix-attribute-timestamp;
+last-seen sub stix-attribute-timestamp;
+time-date-stamp sub stix-attribute-timestamp;
+end sub stix-attribute-timestamp;
+start sub stix-attribute-timestamp;
+created-time sub stix-attribute-timestamp;
+modified-time sub stix-attribute-timestamp;
+account-created sub stix-attribute-timestamp;
+account-expires sub stix-attribute-timestamp;
+credential-last-changed sub stix-attribute-timestamp;
+account-first-login sub stix-attribute-timestamp;
+account-last-login sub stix-attribute-timestamp;
+validity-not-before sub stix-attribute-timestamp;
+validity-not-after sub stix-attribute-timestamp;
+private-key-usage-period-not-after sub stix-attribute-timestamp;
+private-key-usage-period-not-before sub stix-attribute-timestamp;
+
+custom-attribute sub attribute, value string,
+ plays granular-marking:marked,
+ owns attribute-type;
+
+attribute-type sub attribute, value string;
\ No newline at end of file
diff --git a/src/test/resources/parsing/correct_defines/ParsingTestData.txt b/src/test/resources/parsing/correct_defines/ParsingTestData.txt
new file mode 100644
index 0000000..2e18bd9
--- /dev/null
+++ b/src/test/resources/parsing/correct_defines/ParsingTestData.txt
@@ -0,0 +1,14789 @@
+TypeQL file(0,39658)
+ PsiTypeQLElement(eof_queries) - Location: (0,39658)(0,39658)
+ PsiTypeQLElement(query) - Location: (0,39658)(0,39658)
+ PsiTypeQLElement(query_define) - Location: (0,39658)(0,39658)
+ PsiTypeQLElement(clause_define) - Location: (0,39658)(0,39658)
+ PsiElement('define')('define')(0,6)
+ PsiWhiteSpace('\n\n')(6,8)
+ PsiComment(COMMENT)('# Based on https://docs.oasis-open.org/cti/stix/v2.1/cs01/stix-v2.1-cs01.html#-disnqa06jm5\n')(8,99)
+ PsiWhiteSpace('\n')(99,100)
+ PsiComment(COMMENT)('### 1 Base Entities ###\n')(100,124)
+ PsiWhiteSpace('\n')(124,125)
+ PsiTypeQLElement(definables) - Location: (125,39658)(125,39658)
+ PsiTypeQLElement(definable) - Location: (125,161)(125,161)
+ PsiTypeQLStatementType(statement_type) - Location: (125,161)(125,161)
+ PsiTypeQLElement(type_any) - Location: (125,136)(125,136)
+ PsiTypeQLType(type) - Name: stix-entity - Location: (125,136)(125,136)
+ PsiTypeQLElement(label) - Location: (125,136)(125,136)
+ PsiElement(LABEL_)('stix-entity')(125,136)
+ PsiWhiteSpace(' ')(136,137)
+ PsiTypeQLElement(type_constraint) - Location: (137,147)(137,147)
+ PsiElement(SUB_)('sub')(137,140)
+ PsiWhiteSpace(' ')(140,141)
+ PsiTypeQLElement(type_any) - Location: (141,147)(141,147)
+ PsiTypeQLElement(type) - Location: (141,147)(141,147)
+ PsiTypeQLElement(label) - Location: (141,147)(141,147)
+ PsiTypeQLElement(type_native) - Location: (141,147)(141,147)
+ PsiElement('entity')('entity')(141,147)
+ PsiElement(',')(',')(147,148)
+ PsiWhiteSpace('\n ')(148,153)
+ PsiTypeQLElement(type_constraint) - Location: (153,161)(153,161)
+ PsiElement('abstract')('abstract')(153,161)
+ PsiElement(';')(';')(161,162)
+ PsiWhiteSpace('\n\n')(162,164)
+ PsiTypeQLElement(definable) - Location: (164,298)(164,298)
+ PsiTypeQLStatementType(statement_type) - Location: (164,298)(164,298)
+ PsiTypeQLElement(type_any) - Location: (164,175)(164,175)
+ PsiTypeQLType(type) - Name: stix-object - Location: (164,175)(164,175)
+ PsiTypeQLElement(label) - Location: (164,175)(164,175)
+ PsiElement(LABEL_)('stix-object')(164,175)
+ PsiWhiteSpace(' ')(175,176)
+ PsiTypeQLSubType(type_constraint) - Location: (176,191)(176,191)
+ PsiElement(SUB_)('sub')(176,179)
+ PsiWhiteSpace(' ')(179,180)
+ PsiTypeQLElement(type_any) - Location: (180,191)(180,191)
+ PsiTypeQLElement(type) - Location: (180,191)(180,191)
+ PsiTypeQLElement(label) - Location: (180,191)(180,191)
+ PsiElement(LABEL_)('stix-entity')(180,191)
+ PsiElement(',')(',')(191,192)
+ PsiWhiteSpace('\n ')(192,197)
+ PsiTypeQLOwnsType(type_constraint) - Location: (197,211)(197,211)
+ PsiElement('owns')('owns')(197,201)
+ PsiWhiteSpace(' ')(201,202)
+ PsiTypeQLElement(type) - Location: (202,211)(202,211)
+ PsiTypeQLElement(label) - Location: (202,211)(202,211)
+ PsiElement(LABEL_)('stix-type')(202,211)
+ PsiTypeQLElement(annotations_owns) - Location: (211,211)(211,211)
+
+ PsiElement(',')(',')(211,212)
+ PsiWhiteSpace('\n ')(212,217)
+ PsiTypeQLOwnsType(type_constraint) - Location: (217,234)(217,234)
+ PsiElement('owns')('owns')(217,221)
+ PsiWhiteSpace(' ')(221,222)
+ PsiTypeQLElement(type) - Location: (222,229)(222,229)
+ PsiTypeQLElement(label) - Location: (222,229)(222,229)
+ PsiElement(LABEL_)('stix-id')(222,229)
+ PsiWhiteSpace(' ')(229,230)
+ PsiTypeQLElement(annotations_owns) - Location: (230,234)(230,234)
+ PsiElement('@key')('@key')(230,234)
+ PsiElement(',')(',')(234,235)
+ PsiWhiteSpace('\n ')(235,240)
+ PsiTypeQLOwnsType(type_constraint) - Location: (240,261)(240,261)
+ PsiElement('owns')('owns')(240,244)
+ PsiWhiteSpace(' ')(244,245)
+ PsiTypeQLElement(type) - Location: (245,261)(245,261)
+ PsiTypeQLElement(label) - Location: (245,261)(245,261)
+ PsiElement(LABEL_)('custom-attribute')(245,261)
+ PsiTypeQLElement(annotations_owns) - Location: (261,261)(261,261)
+
+ PsiElement(',')(',')(261,262)
+ PsiWhiteSpace('\n\n ')(262,268)
+ PsiTypeQLPlaysType(type_constraint) - Location: (268,298)(268,298)
+ PsiElement('plays')('plays')(268,273)
+ PsiWhiteSpace(' ')(273,274)
+ PsiTypeQLElement(type_scoped) - Location: (274,298)(274,298)
+ PsiTypeQLElement(label_scoped) - Location: (274,298)(274,298)
+ PsiElement(LABEL_SCOPED_)('granular-marking:marking')(274,298)
+ PsiElement(';')(';')(298,299)
+ PsiWhiteSpace('\n\n')(299,301)
+ PsiTypeQLElement(definable) - Location: (301,528)(301,528)
+ PsiTypeQLStatementType(statement_type) - Location: (301,528)(301,528)
+ PsiTypeQLElement(type_any) - Location: (301,317)(301,317)
+ PsiTypeQLType(type) - Name: stix-core-object - Location: (301,317)(301,317)
+ PsiTypeQLElement(label) - Location: (301,317)(301,317)
+ PsiElement(LABEL_)('stix-core-object')(301,317)
+ PsiWhiteSpace(' ')(317,318)
+ PsiTypeQLSubType(type_constraint) - Location: (318,333)(318,333)
+ PsiElement(SUB_)('sub')(318,321)
+ PsiWhiteSpace(' ')(321,322)
+ PsiTypeQLElement(type_any) - Location: (322,333)(322,333)
+ PsiTypeQLElement(type) - Location: (322,333)(322,333)
+ PsiTypeQLElement(label) - Location: (322,333)(322,333)
+ PsiElement(LABEL_)('stix-object')(322,333)
+ PsiElement(',')(',')(333,334)
+ PsiWhiteSpace('\n ')(334,339)
+ PsiTypeQLOwnsType(type_constraint) - Location: (339,356)(339,356)
+ PsiElement('owns')('owns')(339,343)
+ PsiWhiteSpace(' ')(343,344)
+ PsiTypeQLElement(type) - Location: (344,356)(344,356)
+ PsiTypeQLElement(label) - Location: (344,356)(344,356)
+ PsiElement(LABEL_)('spec-version')(344,356)
+ PsiTypeQLElement(annotations_owns) - Location: (356,356)(356,356)
+
+ PsiElement(',')(',')(356,357)
+ PsiWhiteSpace('\n\n ')(357,363)
+ PsiTypeQLPlaysType(type_constraint) - Location: (363,390)(363,390)
+ PsiElement('plays')('plays')(363,368)
+ PsiWhiteSpace(' ')(368,369)
+ PsiTypeQLElement(type_scoped) - Location: (369,390)(369,390)
+ PsiTypeQLElement(label_scoped) - Location: (369,390)(369,390)
+ PsiElement(LABEL_SCOPED_)('object-marking:marked')(369,390)
+ PsiElement(',')(',')(390,391)
+ PsiWhiteSpace('\n ')(391,396)
+ PsiTypeQLPlaysType(type_constraint) - Location: (396,420)(396,420)
+ PsiElement('plays')('plays')(396,401)
+ PsiWhiteSpace(' ')(401,402)
+ PsiTypeQLElement(type_scoped) - Location: (402,420)(402,420)
+ PsiTypeQLElement(label_scoped) - Location: (402,420)(402,420)
+ PsiElement(LABEL_SCOPED_)('created-by:created')(402,420)
+ PsiElement(',')(',')(420,421)
+ PsiWhiteSpace('\n ')(421,426)
+ PsiTypeQLPlaysType(type_constraint) - Location: (426,455)(426,455)
+ PsiElement('plays')('plays')(426,431)
+ PsiWhiteSpace(' ')(431,432)
+ PsiTypeQLElement(type_scoped) - Location: (432,455)(432,455)
+ PsiTypeQLElement(label_scoped) - Location: (432,455)(432,455)
+ PsiElement(LABEL_SCOPED_)('derivation:derived-from')(432,455)
+ PsiElement(',')(',')(455,456)
+ PsiWhiteSpace('\n ')(456,461)
+ PsiTypeQLPlaysType(type_constraint) - Location: (461,486)(461,486)
+ PsiElement('plays')('plays')(461,466)
+ PsiWhiteSpace(' ')(466,467)
+ PsiTypeQLElement(type_scoped) - Location: (467,486)(467,486)
+ PsiTypeQLElement(label_scoped) - Location: (467,486)(467,486)
+ PsiElement(LABEL_SCOPED_)('derivation:deriving')(467,486)
+ PsiElement(',')(',')(486,487)
+ PsiWhiteSpace('\n ')(487,492)
+ PsiTypeQLPlaysType(type_constraint) - Location: (492,528)(492,528)
+ PsiElement('plays')('plays')(492,497)
+ PsiWhiteSpace(' ')(497,498)
+ PsiTypeQLElement(type_scoped) - Location: (498,528)(498,528)
+ PsiTypeQLElement(label_scoped) - Location: (498,528)(498,528)
+ PsiElement(LABEL_SCOPED_)('duplicate-of:duplicated-object')(498,528)
+ PsiElement(';')(';')(528,529)
+ PsiWhiteSpace('\n\n\n')(529,532)
+ PsiTypeQLElement(definable) - Location: (532,888)(532,888)
+ PsiTypeQLStatementType(statement_type) - Location: (532,888)(532,888)
+ PsiTypeQLElement(type_any) - Location: (532,550)(532,550)
+ PsiTypeQLType(type) - Name: stix-domain-object - Location: (532,550)(532,550)
+ PsiTypeQLElement(label) - Location: (532,550)(532,550)
+ PsiElement(LABEL_)('stix-domain-object')(532,550)
+ PsiWhiteSpace(' ')(550,551)
+ PsiTypeQLSubType(type_constraint) - Location: (551,571)(551,571)
+ PsiElement(SUB_)('sub')(551,554)
+ PsiWhiteSpace(' ')(554,555)
+ PsiTypeQLElement(type_any) - Location: (555,571)(555,571)
+ PsiTypeQLElement(type) - Location: (555,571)(555,571)
+ PsiTypeQLElement(label) - Location: (555,571)(555,571)
+ PsiElement(LABEL_)('stix-core-object')(555,571)
+ PsiElement(',')(',')(571,572)
+ PsiWhiteSpace('\n ')(572,577)
+ PsiTypeQLOwnsType(type_constraint) - Location: (577,589)(577,589)
+ PsiElement('owns')('owns')(577,581)
+ PsiWhiteSpace(' ')(581,582)
+ PsiTypeQLElement(type) - Location: (582,589)(582,589)
+ PsiTypeQLElement(label) - Location: (582,589)(582,589)
+ PsiElement(LABEL_)('created')(582,589)
+ PsiTypeQLElement(annotations_owns) - Location: (589,589)(589,589)
+
+ PsiElement(',')(',')(589,590)
+ PsiWhiteSpace('\n ')(590,595)
+ PsiTypeQLOwnsType(type_constraint) - Location: (595,608)(595,608)
+ PsiElement('owns')('owns')(595,599)
+ PsiWhiteSpace(' ')(599,600)
+ PsiTypeQLElement(type) - Location: (600,608)(600,608)
+ PsiTypeQLElement(label) - Location: (600,608)(600,608)
+ PsiElement(LABEL_)('modified')(600,608)
+ PsiTypeQLElement(annotations_owns) - Location: (608,608)(608,608)
+
+ PsiElement(',')(',')(608,609)
+ PsiWhiteSpace('\n ')(609,614)
+ PsiTypeQLOwnsType(type_constraint) - Location: (614,626)(614,626)
+ PsiElement('owns')('owns')(614,618)
+ PsiWhiteSpace(' ')(618,619)
+ PsiTypeQLElement(type) - Location: (619,626)(619,626)
+ PsiTypeQLElement(label) - Location: (619,626)(619,626)
+ PsiElement(LABEL_)('revoked')(619,626)
+ PsiTypeQLElement(annotations_owns) - Location: (626,626)(626,626)
+
+ PsiElement(',')(',')(626,627)
+ PsiWhiteSpace('\n ')(627,632)
+ PsiTypeQLOwnsType(type_constraint) - Location: (632,643)(632,643)
+ PsiElement('owns')('owns')(632,636)
+ PsiWhiteSpace(' ')(636,637)
+ PsiTypeQLElement(type) - Location: (637,643)(637,643)
+ PsiTypeQLElement(label) - Location: (637,643)(637,643)
+ PsiElement(LABEL_)('labels')(637,643)
+ PsiTypeQLElement(annotations_owns) - Location: (643,643)(643,643)
+
+ PsiElement(',')(',')(643,644)
+ PsiWhiteSpace('\n ')(644,649)
+ PsiTypeQLOwnsType(type_constraint) - Location: (649,664)(649,664)
+ PsiElement('owns')('owns')(649,653)
+ PsiWhiteSpace(' ')(653,654)
+ PsiTypeQLElement(type) - Location: (654,664)(654,664)
+ PsiTypeQLElement(label) - Location: (654,664)(654,664)
+ PsiElement(LABEL_)('confidence')(654,664)
+ PsiTypeQLElement(annotations_owns) - Location: (664,664)(664,664)
+
+ PsiElement(',')(',')(664,665)
+ PsiWhiteSpace('\n ')(665,670)
+ PsiTypeQLOwnsType(type_constraint) - Location: (670,680)(670,680)
+ PsiElement('owns')('owns')(670,674)
+ PsiWhiteSpace(' ')(674,675)
+ PsiTypeQLElement(type) - Location: (675,680)(675,680)
+ PsiTypeQLElement(label) - Location: (675,680)(675,680)
+ PsiElement(LABEL_)('langs')(675,680)
+ PsiTypeQLElement(annotations_owns) - Location: (680,680)(680,680)
+
+ PsiElement(',')(',')(680,681)
+ PsiWhiteSpace('\n\n ')(681,687)
+ PsiComment(COMMENT)('# Rel\n')(687,693)
+ PsiWhiteSpace(' ')(693,697)
+ PsiTypeQLPlaysType(type_constraint) - Location: (697,723)(697,723)
+ PsiElement('plays')('plays')(697,702)
+ PsiWhiteSpace(' ')(702,703)
+ PsiTypeQLElement(type_scoped) - Location: (703,723)(703,723)
+ PsiTypeQLElement(label_scoped) - Location: (703,723)(703,723)
+ PsiElement(LABEL_SCOPED_)('sighting:sighting-of')(703,723)
+ PsiElement(',')(',')(723,724)
+ PsiWhiteSpace('\n ')(724,729)
+ PsiTypeQLPlaysType(type_constraint) - Location: (729,766)(729,766)
+ PsiElement('plays')('plays')(729,734)
+ PsiWhiteSpace(' ')(734,735)
+ PsiTypeQLElement(type_scoped) - Location: (735,766)(735,766)
+ PsiTypeQLElement(label_scoped) - Location: (735,766)(735,766)
+ PsiElement(LABEL_SCOPED_)('external-references:referencing')(735,766)
+ PsiElement(',')(',')(766,767)
+ PsiWhiteSpace('\n\n ')(767,773)
+ PsiComment(COMMENT)('# RRel\n')(773,780)
+ PsiWhiteSpace(' ')(780,784)
+ PsiTypeQLPlaysType(type_constraint) - Location: (784,812)(784,812)
+ PsiElement('plays')('plays')(784,789)
+ PsiWhiteSpace(' ')(789,790)
+ PsiTypeQLElement(type_scoped) - Location: (790,812)(790,812)
+ PsiTypeQLElement(label_scoped) - Location: (790,812)(790,812)
+ PsiElement(LABEL_SCOPED_)('kill-chain-phases:used')(790,812)
+ PsiElement(',')(',')(812,813)
+ PsiWhiteSpace('\n ')(813,818)
+ PsiTypeQLPlaysType(type_constraint) - Location: (818,846)(818,846)
+ PsiElement('plays')('plays')(818,823)
+ PsiWhiteSpace(' ')(823,824)
+ PsiTypeQLElement(type_scoped) - Location: (824,846)(824,846)
+ PsiTypeQLElement(label_scoped) - Location: (824,846)(824,846)
+ PsiElement(LABEL_SCOPED_)('sighting:observed-data')(824,846)
+ PsiElement(',')(',')(846,847)
+ PsiWhiteSpace('\n ')(847,852)
+ PsiTypeQLPlaysType(type_constraint) - Location: (852,888)(852,888)
+ PsiElement('plays')('plays')(852,857)
+ PsiWhiteSpace(' ')(857,858)
+ PsiTypeQLElement(type_scoped) - Location: (858,888)(858,888)
+ PsiTypeQLElement(label_scoped) - Location: (858,888)(858,888)
+ PsiElement(LABEL_SCOPED_)('external-references:referenced')(858,888)
+ PsiElement(';')(';')(888,889)
+ PsiWhiteSpace('\n\n\n')(889,892)
+ PsiTypeQLElement(definable) - Location: (892,1103)(892,1103)
+ PsiTypeQLStatementType(statement_type) - Location: (892,1103)(892,1103)
+ PsiTypeQLElement(type_any) - Location: (892,920)(892,920)
+ PsiTypeQLType(type) - Name: stix-cyber-observable-object - Location: (892,920)(892,920)
+ PsiTypeQLElement(label) - Location: (892,920)(892,920)
+ PsiElement(LABEL_)('stix-cyber-observable-object')(892,920)
+ PsiWhiteSpace(' ')(920,921)
+ PsiTypeQLSubType(type_constraint) - Location: (921,941)(921,941)
+ PsiElement(SUB_)('sub')(921,924)
+ PsiWhiteSpace(' ')(924,925)
+ PsiTypeQLElement(type_any) - Location: (925,941)(925,941)
+ PsiTypeQLElement(type) - Location: (925,941)(925,941)
+ PsiTypeQLElement(label) - Location: (925,941)(925,941)
+ PsiElement(LABEL_)('stix-core-object')(925,941)
+ PsiElement(',')(',')(941,942)
+ PsiWhiteSpace('\n ')(942,947)
+ PsiTypeQLOwnsType(type_constraint) - Location: (947,960)(947,960)
+ PsiElement('owns')('owns')(947,951)
+ PsiWhiteSpace(' ')(951,952)
+ PsiTypeQLElement(type) - Location: (952,960)(952,960)
+ PsiTypeQLElement(label) - Location: (952,960)(952,960)
+ PsiElement(LABEL_)('defanged')(952,960)
+ PsiTypeQLElement(annotations_owns) - Location: (960,960)(960,960)
+
+ PsiElement(',')(',')(960,961)
+ PsiWhiteSpace('\n\n ')(961,967)
+ PsiComment(COMMENT)('# Rel\n')(967,973)
+ PsiWhiteSpace(' ')(973,977)
+ PsiTypeQLPlaysType(type_constraint) - Location: (977,1014)(977,1014)
+ PsiElement('plays')('plays')(977,982)
+ PsiWhiteSpace(' ')(982,983)
+ PsiTypeQLElement(type_scoped) - Location: (983,1014)(983,1014)
+ PsiTypeQLElement(label_scoped) - Location: (983,1014)(983,1014)
+ PsiElement(LABEL_SCOPED_)('external-references:referencing')(983,1014)
+ PsiElement(',')(',')(1014,1015)
+ PsiWhiteSpace('\n ')(1015,1020)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1020,1049)(1020,1049)
+ PsiElement('plays')('plays')(1020,1025)
+ PsiWhiteSpace(' ')(1025,1026)
+ PsiTypeQLElement(type_scoped) - Location: (1026,1049)(1026,1049)
+ PsiTypeQLElement(label_scoped) - Location: (1026,1049)(1026,1049)
+ PsiElement(LABEL_SCOPED_)('contains-ref:containing')(1026,1049)
+ PsiElement(',')(',')(1049,1050)
+ PsiWhiteSpace('\n\n ')(1050,1056)
+ PsiComment(COMMENT)('# RRel\n')(1056,1063)
+ PsiWhiteSpace(' ')(1063,1067)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1067,1103)(1067,1103)
+ PsiElement('plays')('plays')(1067,1072)
+ PsiWhiteSpace(' ')(1072,1073)
+ PsiTypeQLElement(type_scoped) - Location: (1073,1103)(1073,1103)
+ PsiTypeQLElement(label_scoped) - Location: (1073,1103)(1073,1103)
+ PsiElement(LABEL_SCOPED_)('external-references:referenced')(1073,1103)
+ PsiElement(';')(';')(1103,1104)
+ PsiWhiteSpace('\n\n')(1104,1106)
+ PsiTypeQLElement(definable) - Location: (1106,1211)(1106,1211)
+ PsiTypeQLStatementType(statement_type) - Location: (1106,1211)(1106,1211)
+ PsiTypeQLElement(type_any) - Location: (1106,1121)(1106,1121)
+ PsiTypeQLType(type) - Name: stix-sub-object - Location: (1106,1121)(1106,1121)
+ PsiTypeQLElement(label) - Location: (1106,1121)(1106,1121)
+ PsiElement(LABEL_)('stix-sub-object')(1106,1121)
+ PsiWhiteSpace(' ')(1121,1122)
+ PsiTypeQLSubType(type_constraint) - Location: (1122,1137)(1122,1137)
+ PsiElement(SUB_)('sub')(1122,1125)
+ PsiWhiteSpace(' ')(1125,1126)
+ PsiTypeQLElement(type_any) - Location: (1126,1137)(1126,1137)
+ PsiTypeQLElement(type) - Location: (1126,1137)(1126,1137)
+ PsiTypeQLElement(label) - Location: (1126,1137)(1126,1137)
+ PsiElement(LABEL_)('stix-entity')(1126,1137)
+ PsiElement(',')(',')(1137,1138)
+ PsiWhiteSpace('\n ')(1138,1143)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1143,1155)(1143,1155)
+ PsiElement('owns')('owns')(1143,1147)
+ PsiWhiteSpace(' ')(1147,1148)
+ PsiTypeQLElement(type) - Location: (1148,1155)(1148,1155)
+ PsiTypeQLElement(label) - Location: (1148,1155)(1148,1155)
+ PsiElement(LABEL_)('created')(1148,1155)
+ PsiTypeQLElement(annotations_owns) - Location: (1155,1155)(1155,1155)
+
+ PsiElement(',')(',')(1155,1156)
+ PsiWhiteSpace('\n ')(1156,1161)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1161,1174)(1161,1174)
+ PsiElement('owns')('owns')(1161,1165)
+ PsiWhiteSpace(' ')(1165,1166)
+ PsiTypeQLElement(type) - Location: (1166,1174)(1166,1174)
+ PsiTypeQLElement(label) - Location: (1166,1174)(1166,1174)
+ PsiElement(LABEL_)('modified')(1166,1174)
+ PsiTypeQLElement(annotations_owns) - Location: (1174,1174)(1174,1174)
+
+ PsiElement(',')(',')(1174,1175)
+ PsiWhiteSpace('\n\n ')(1175,1181)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1181,1211)(1181,1211)
+ PsiElement('plays')('plays')(1181,1186)
+ PsiWhiteSpace(' ')(1186,1187)
+ PsiTypeQLElement(type_scoped) - Location: (1187,1211)(1187,1211)
+ PsiTypeQLElement(label_scoped) - Location: (1187,1211)(1187,1211)
+ PsiElement(LABEL_SCOPED_)('granular-marking:marking')(1187,1211)
+ PsiElement(';')(';')(1211,1212)
+ PsiWhiteSpace('\n\n\n')(1212,1215)
+ PsiComment(COMMENT)('### 2 Data Types ###\n')(1215,1236)
+ PsiWhiteSpace('\n')(1236,1237)
+ PsiTypeQLElement(definable) - Location: (1237,1434)(1237,1434)
+ PsiTypeQLStatementType(statement_type) - Location: (1237,1434)(1237,1434)
+ PsiTypeQLElement(type_any) - Location: (1237,1255)(1237,1255)
+ PsiTypeQLType(type) - Name: external-reference - Location: (1237,1255)(1237,1255)
+ PsiTypeQLElement(label) - Location: (1237,1255)(1237,1255)
+ PsiElement(LABEL_)('external-reference')(1237,1255)
+ PsiWhiteSpace(' ')(1255,1256)
+ PsiTypeQLSubType(type_constraint) - Location: (1256,1275)(1256,1275)
+ PsiElement(SUB_)('sub')(1256,1259)
+ PsiWhiteSpace(' ')(1259,1260)
+ PsiTypeQLElement(type_any) - Location: (1260,1275)(1260,1275)
+ PsiTypeQLElement(type) - Location: (1260,1275)(1260,1275)
+ PsiTypeQLElement(label) - Location: (1260,1275)(1260,1275)
+ PsiElement(LABEL_)('stix-sub-object')(1260,1275)
+ PsiElement(',')(',')(1275,1276)
+ PsiWhiteSpace('\n ')(1276,1281)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1281,1297)(1281,1297)
+ PsiElement('owns')('owns')(1281,1285)
+ PsiWhiteSpace(' ')(1285,1286)
+ PsiTypeQLElement(type) - Location: (1286,1297)(1286,1297)
+ PsiTypeQLElement(label) - Location: (1286,1297)(1286,1297)
+ PsiElement(LABEL_)('source-name')(1286,1297)
+ PsiTypeQLElement(annotations_owns) - Location: (1297,1297)(1297,1297)
+
+ PsiElement(',')(',')(1297,1298)
+ PsiWhiteSpace('\n ')(1298,1303)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1303,1319)(1303,1319)
+ PsiElement('owns')('owns')(1303,1307)
+ PsiWhiteSpace(' ')(1307,1308)
+ PsiTypeQLElement(type) - Location: (1308,1319)(1308,1319)
+ PsiTypeQLElement(label) - Location: (1308,1319)(1308,1319)
+ PsiElement(LABEL_)('description')(1308,1319)
+ PsiTypeQLElement(annotations_owns) - Location: (1319,1319)(1319,1319)
+
+ PsiElement(',')(',')(1319,1320)
+ PsiWhiteSpace('\n ')(1320,1325)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1325,1338)(1325,1338)
+ PsiElement('owns')('owns')(1325,1329)
+ PsiWhiteSpace(' ')(1329,1330)
+ PsiTypeQLElement(type) - Location: (1330,1338)(1330,1338)
+ PsiTypeQLElement(label) - Location: (1330,1338)(1330,1338)
+ PsiElement(LABEL_)('url-link')(1330,1338)
+ PsiTypeQLElement(annotations_owns) - Location: (1338,1338)(1338,1338)
+
+ PsiElement(',')(',')(1338,1339)
+ PsiWhiteSpace('\n ')(1339,1344)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1344,1360)(1344,1360)
+ PsiElement('owns')('owns')(1344,1348)
+ PsiWhiteSpace(' ')(1348,1349)
+ PsiTypeQLElement(type) - Location: (1349,1360)(1349,1360)
+ PsiTypeQLElement(label) - Location: (1349,1360)(1349,1360)
+ PsiElement(LABEL_)('external-id')(1349,1360)
+ PsiTypeQLElement(annotations_owns) - Location: (1360,1360)(1360,1360)
+
+ PsiElement(',')(',')(1360,1361)
+ PsiWhiteSpace('\n\n ')(1361,1367)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1367,1392)(1367,1392)
+ PsiElement('plays')('plays')(1367,1372)
+ PsiWhiteSpace(' ')(1372,1373)
+ PsiTypeQLElement(type_scoped) - Location: (1373,1392)(1373,1392)
+ PsiTypeQLElement(label_scoped) - Location: (1373,1392)(1373,1392)
+ PsiElement(LABEL_SCOPED_)('hashes:hashes-owner')(1373,1392)
+ PsiElement(',')(',')(1392,1393)
+ PsiWhiteSpace('\n ')(1393,1398)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1398,1434)(1398,1434)
+ PsiElement('plays')('plays')(1398,1403)
+ PsiWhiteSpace(' ')(1403,1404)
+ PsiTypeQLElement(type_scoped) - Location: (1404,1434)(1404,1434)
+ PsiTypeQLElement(label_scoped) - Location: (1404,1434)(1404,1434)
+ PsiElement(LABEL_SCOPED_)('external-references:referenced')(1404,1434)
+ PsiElement(';')(';')(1434,1435)
+ PsiWhiteSpace('\n\n')(1435,1437)
+ PsiTypeQLElement(definable) - Location: (1437,1567)(1437,1567)
+ PsiTypeQLStatementType(statement_type) - Location: (1437,1567)(1437,1567)
+ PsiTypeQLElement(type_any) - Location: (1437,1453)(1437,1453)
+ PsiTypeQLType(type) - Name: kill-chain-phase - Location: (1437,1453)(1437,1453)
+ PsiTypeQLElement(label) - Location: (1437,1453)(1437,1453)
+ PsiElement(LABEL_)('kill-chain-phase')(1437,1453)
+ PsiWhiteSpace(' ')(1453,1454)
+ PsiTypeQLSubType(type_constraint) - Location: (1454,1473)(1454,1473)
+ PsiElement(SUB_)('sub')(1454,1457)
+ PsiWhiteSpace(' ')(1457,1458)
+ PsiTypeQLElement(type_any) - Location: (1458,1473)(1458,1473)
+ PsiTypeQLElement(type) - Location: (1458,1473)(1458,1473)
+ PsiTypeQLElement(label) - Location: (1458,1473)(1458,1473)
+ PsiElement(LABEL_)('stix-sub-object')(1458,1473)
+ PsiElement(',')(',')(1473,1474)
+ PsiWhiteSpace('\n ')(1474,1479)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1479,1499)(1479,1499)
+ PsiElement('owns')('owns')(1479,1483)
+ PsiWhiteSpace(' ')(1483,1484)
+ PsiTypeQLElement(type) - Location: (1484,1499)(1484,1499)
+ PsiTypeQLElement(label) - Location: (1484,1499)(1484,1499)
+ PsiElement(LABEL_)('kill-chain-name')(1484,1499)
+ PsiTypeQLElement(annotations_owns) - Location: (1499,1499)(1499,1499)
+
+ PsiElement(',')(',')(1499,1500)
+ PsiWhiteSpace('\n ')(1500,1505)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1505,1531)(1505,1531)
+ PsiElement('owns')('owns')(1505,1509)
+ PsiWhiteSpace(' ')(1509,1510)
+ PsiTypeQLElement(type) - Location: (1510,1531)(1510,1531)
+ PsiTypeQLElement(label) - Location: (1510,1531)(1510,1531)
+ PsiElement(LABEL_)('kill-chain-phase-name')(1510,1531)
+ PsiTypeQLElement(annotations_owns) - Location: (1531,1531)(1531,1531)
+
+ PsiElement(',')(',')(1531,1532)
+ PsiWhiteSpace('\n\n ')(1532,1538)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1538,1567)(1538,1567)
+ PsiElement('plays')('plays')(1538,1543)
+ PsiWhiteSpace(' ')(1543,1544)
+ PsiTypeQLElement(type_scoped) - Location: (1544,1567)(1544,1567)
+ PsiTypeQLElement(label_scoped) - Location: (1544,1567)(1544,1567)
+ PsiElement(LABEL_SCOPED_)('kill-chain-phases:using')(1544,1567)
+ PsiElement(';')(';')(1567,1568)
+ PsiWhiteSpace('\n\n')(1568,1570)
+ PsiComment(COMMENT)('### 3 SDOs ###\n')(1570,1585)
+ PsiWhiteSpace('\n')(1585,1586)
+ PsiTypeQLElement(definable) - Location: (1586,1866)(1586,1866)
+ PsiTypeQLStatementType(statement_type) - Location: (1586,1866)(1586,1866)
+ PsiTypeQLElement(type_any) - Location: (1586,1600)(1586,1600)
+ PsiTypeQLType(type) - Name: attack-pattern - Location: (1586,1600)(1586,1600)
+ PsiTypeQLElement(label) - Location: (1586,1600)(1586,1600)
+ PsiElement(LABEL_)('attack-pattern')(1586,1600)
+ PsiWhiteSpace(' ')(1600,1601)
+ PsiTypeQLSubType(type_constraint) - Location: (1601,1623)(1601,1623)
+ PsiElement(SUB_)('sub')(1601,1604)
+ PsiWhiteSpace(' ')(1604,1605)
+ PsiTypeQLElement(type_any) - Location: (1605,1623)(1605,1623)
+ PsiTypeQLElement(type) - Location: (1605,1623)(1605,1623)
+ PsiTypeQLElement(label) - Location: (1605,1623)(1605,1623)
+ PsiElement(LABEL_)('stix-domain-object')(1605,1623)
+ PsiElement(',')(',')(1623,1624)
+ PsiWhiteSpace('\n ')(1624,1629)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1629,1638)(1629,1638)
+ PsiElement('owns')('owns')(1629,1633)
+ PsiWhiteSpace(' ')(1633,1634)
+ PsiTypeQLElement(type) - Location: (1634,1638)(1634,1638)
+ PsiTypeQLElement(label) - Location: (1634,1638)(1634,1638)
+ PsiElement(LABEL_)('name')(1634,1638)
+ PsiTypeQLElement(annotations_owns) - Location: (1638,1638)(1638,1638)
+
+ PsiElement(',')(',')(1638,1639)
+ PsiWhiteSpace('\n ')(1639,1644)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1644,1660)(1644,1660)
+ PsiElement('owns')('owns')(1644,1648)
+ PsiWhiteSpace(' ')(1648,1649)
+ PsiTypeQLElement(type) - Location: (1649,1660)(1649,1660)
+ PsiTypeQLElement(label) - Location: (1649,1660)(1649,1660)
+ PsiElement(LABEL_)('description')(1649,1660)
+ PsiTypeQLElement(annotations_owns) - Location: (1660,1660)(1660,1660)
+
+ PsiElement(',')(',')(1660,1661)
+ PsiWhiteSpace('\n ')(1661,1666)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1666,1678)(1666,1678)
+ PsiElement('owns')('owns')(1666,1670)
+ PsiWhiteSpace(' ')(1670,1671)
+ PsiTypeQLElement(type) - Location: (1671,1678)(1671,1678)
+ PsiTypeQLElement(label) - Location: (1671,1678)(1671,1678)
+ PsiElement(LABEL_)('aliases')(1671,1678)
+ PsiTypeQLElement(annotations_owns) - Location: (1678,1678)(1678,1678)
+
+ PsiElement(',')(',')(1678,1679)
+ PsiWhiteSpace('\n\n ')(1679,1685)
+ PsiComment(COMMENT)('# Rel\n')(1685,1691)
+ PsiWhiteSpace(' ')(1691,1695)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1695,1720)(1695,1720)
+ PsiElement('plays')('plays')(1695,1700)
+ PsiWhiteSpace(' ')(1700,1701)
+ PsiTypeQLElement(type_scoped) - Location: (1701,1720)(1701,1720)
+ PsiTypeQLElement(label_scoped) - Location: (1701,1720)(1701,1720)
+ PsiElement(LABEL_SCOPED_)('delivers:delivering')(1701,1720)
+ PsiElement(',')(',')(1720,1721)
+ PsiWhiteSpace('\n ')(1721,1726)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1726,1749)(1726,1749)
+ PsiElement('plays')('plays')(1726,1731)
+ PsiWhiteSpace(' ')(1731,1732)
+ PsiTypeQLElement(type_scoped) - Location: (1732,1749)(1732,1749)
+ PsiTypeQLElement(label_scoped) - Location: (1732,1749)(1732,1749)
+ PsiElement(LABEL_SCOPED_)('targets:targeting')(1732,1749)
+ PsiElement(',')(',')(1749,1750)
+ PsiWhiteSpace('\n ')(1750,1755)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1755,1771)(1755,1771)
+ PsiElement('plays')('plays')(1755,1760)
+ PsiWhiteSpace(' ')(1760,1761)
+ PsiTypeQLElement(type_scoped) - Location: (1761,1771)(1761,1771)
+ PsiTypeQLElement(label_scoped) - Location: (1761,1771)(1761,1771)
+ PsiElement(LABEL_SCOPED_)('uses:using')(1761,1771)
+ PsiElement(',')(',')(1771,1772)
+ PsiWhiteSpace('\n\n ')(1772,1778)
+ PsiComment(COMMENT)('# RRel\n')(1778,1785)
+ PsiWhiteSpace(' ')(1785,1789)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1789,1814)(1789,1814)
+ PsiElement('plays')('plays')(1789,1794)
+ PsiWhiteSpace(' ')(1794,1795)
+ PsiTypeQLElement(type_scoped) - Location: (1795,1814)(1795,1814)
+ PsiTypeQLElement(label_scoped) - Location: (1795,1814)(1795,1814)
+ PsiElement(LABEL_SCOPED_)('indicates:indicated')(1795,1814)
+ PsiElement(',')(',')(1814,1815)
+ PsiWhiteSpace('\n ')(1815,1820)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1820,1835)(1820,1835)
+ PsiElement('plays')('plays')(1820,1825)
+ PsiWhiteSpace(' ')(1825,1826)
+ PsiTypeQLElement(type_scoped) - Location: (1826,1835)(1826,1835)
+ PsiTypeQLElement(label_scoped) - Location: (1826,1835)(1826,1835)
+ PsiElement(LABEL_SCOPED_)('uses:used')(1826,1835)
+ PsiElement(',')(',')(1835,1836)
+ PsiWhiteSpace('\n ')(1836,1841)
+ PsiTypeQLPlaysType(type_constraint) - Location: (1841,1866)(1841,1866)
+ PsiElement('plays')('plays')(1841,1846)
+ PsiWhiteSpace(' ')(1846,1847)
+ PsiTypeQLElement(type_scoped) - Location: (1847,1866)(1847,1866)
+ PsiTypeQLElement(label_scoped) - Location: (1847,1866)(1847,1866)
+ PsiElement(LABEL_SCOPED_)('mitigates:mitigated')(1847,1866)
+ PsiElement(';')(';')(1866,1867)
+ PsiWhiteSpace('\n\n')(1867,1869)
+ PsiTypeQLElement(definable) - Location: (1869,2233)(1869,2233)
+ PsiTypeQLStatementType(statement_type) - Location: (1869,2233)(1869,2233)
+ PsiTypeQLElement(type_any) - Location: (1869,1877)(1869,1877)
+ PsiTypeQLType(type) - Name: campaign - Location: (1869,1877)(1869,1877)
+ PsiTypeQLElement(label) - Location: (1869,1877)(1869,1877)
+ PsiElement(LABEL_)('campaign')(1869,1877)
+ PsiWhiteSpace(' ')(1877,1878)
+ PsiTypeQLSubType(type_constraint) - Location: (1878,1900)(1878,1900)
+ PsiElement(SUB_)('sub')(1878,1881)
+ PsiWhiteSpace(' ')(1881,1882)
+ PsiTypeQLElement(type_any) - Location: (1882,1900)(1882,1900)
+ PsiTypeQLElement(type) - Location: (1882,1900)(1882,1900)
+ PsiTypeQLElement(label) - Location: (1882,1900)(1882,1900)
+ PsiElement(LABEL_)('stix-domain-object')(1882,1900)
+ PsiElement(',')(',')(1900,1901)
+ PsiWhiteSpace('\n ')(1901,1906)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1906,1915)(1906,1915)
+ PsiElement('owns')('owns')(1906,1910)
+ PsiWhiteSpace(' ')(1910,1911)
+ PsiTypeQLElement(type) - Location: (1911,1915)(1911,1915)
+ PsiTypeQLElement(label) - Location: (1911,1915)(1911,1915)
+ PsiElement(LABEL_)('name')(1911,1915)
+ PsiTypeQLElement(annotations_owns) - Location: (1915,1915)(1915,1915)
+
+ PsiElement(',')(',')(1915,1916)
+ PsiWhiteSpace('\n ')(1916,1921)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1921,1937)(1921,1937)
+ PsiElement('owns')('owns')(1921,1925)
+ PsiWhiteSpace(' ')(1925,1926)
+ PsiTypeQLElement(type) - Location: (1926,1937)(1926,1937)
+ PsiTypeQLElement(label) - Location: (1926,1937)(1926,1937)
+ PsiElement(LABEL_)('description')(1926,1937)
+ PsiTypeQLElement(annotations_owns) - Location: (1937,1937)(1937,1937)
+
+ PsiElement(',')(',')(1937,1938)
+ PsiWhiteSpace('\n ')(1938,1943)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1943,1955)(1943,1955)
+ PsiElement('owns')('owns')(1943,1947)
+ PsiWhiteSpace(' ')(1947,1948)
+ PsiTypeQLElement(type) - Location: (1948,1955)(1948,1955)
+ PsiTypeQLElement(label) - Location: (1948,1955)(1948,1955)
+ PsiElement(LABEL_)('aliases')(1948,1955)
+ PsiTypeQLElement(annotations_owns) - Location: (1955,1955)(1955,1955)
+
+ PsiElement(',')(',')(1955,1956)
+ PsiWhiteSpace('\n ')(1956,1961)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1961,1976)(1961,1976)
+ PsiElement('owns')('owns')(1961,1965)
+ PsiWhiteSpace(' ')(1965,1966)
+ PsiTypeQLElement(type) - Location: (1966,1976)(1966,1976)
+ PsiTypeQLElement(label) - Location: (1966,1976)(1966,1976)
+ PsiElement(LABEL_)('first-seen')(1966,1976)
+ PsiTypeQLElement(annotations_owns) - Location: (1976,1976)(1976,1976)
+
+ PsiElement(',')(',')(1976,1977)
+ PsiWhiteSpace('\n ')(1977,1982)
+ PsiTypeQLOwnsType(type_constraint) - Location: (1982,1996)(1982,1996)
+ PsiElement('owns')('owns')(1982,1986)
+ PsiWhiteSpace(' ')(1986,1987)
+ PsiTypeQLElement(type) - Location: (1987,1996)(1987,1996)
+ PsiTypeQLElement(label) - Location: (1987,1996)(1987,1996)
+ PsiElement(LABEL_)('last-seen')(1987,1996)
+ PsiTypeQLElement(annotations_owns) - Location: (1996,1996)(1996,1996)
+
+ PsiElement(',')(',')(1996,1997)
+ PsiWhiteSpace('\n ')(1997,2002)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2002,2016)(2002,2016)
+ PsiElement('owns')('owns')(2002,2006)
+ PsiWhiteSpace(' ')(2006,2007)
+ PsiTypeQLElement(type) - Location: (2007,2016)(2007,2016)
+ PsiTypeQLElement(label) - Location: (2007,2016)(2007,2016)
+ PsiElement(LABEL_)('objective')(2007,2016)
+ PsiTypeQLElement(annotations_owns) - Location: (2016,2016)(2016,2016)
+
+ PsiElement(',')(',')(2016,2017)
+ PsiWhiteSpace('\n\n ')(2017,2023)
+ PsiComment(COMMENT)('# Rel\n')(2023,2029)
+ PsiWhiteSpace(' ')(2029,2033)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2033,2056)(2033,2056)
+ PsiElement('plays')('plays')(2033,2038)
+ PsiWhiteSpace(' ')(2038,2039)
+ PsiTypeQLElement(type_scoped) - Location: (2039,2056)(2039,2056)
+ PsiTypeQLElement(label_scoped) - Location: (2039,2056)(2039,2056)
+ PsiElement(LABEL_SCOPED_)('targets:targeting')(2039,2056)
+ PsiElement(',')(',')(2056,2057)
+ PsiWhiteSpace('\n ')(2057,2062)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2062,2093)(2062,2093)
+ PsiElement('plays')('plays')(2062,2067)
+ PsiWhiteSpace(' ')(2067,2068)
+ PsiTypeQLElement(type_scoped) - Location: (2068,2093)(2068,2093)
+ PsiTypeQLElement(label_scoped) - Location: (2068,2093)(2068,2093)
+ PsiElement(LABEL_SCOPED_)('attributed-to:attributing')(2068,2093)
+ PsiElement(',')(',')(2093,2094)
+ PsiWhiteSpace('\n ')(2094,2099)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2099,2115)(2099,2115)
+ PsiElement('plays')('plays')(2099,2104)
+ PsiWhiteSpace(' ')(2104,2105)
+ PsiTypeQLElement(type_scoped) - Location: (2105,2115)(2105,2115)
+ PsiTypeQLElement(label_scoped) - Location: (2105,2115)(2105,2115)
+ PsiElement(LABEL_SCOPED_)('uses:using')(2105,2115)
+ PsiElement(',')(',')(2115,2116)
+ PsiWhiteSpace('\n ')(2116,2121)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2121,2151)(2121,2151)
+ PsiElement('plays')('plays')(2121,2126)
+ PsiWhiteSpace(' ')(2126,2127)
+ PsiTypeQLElement(type_scoped) - Location: (2127,2151)(2127,2151)
+ PsiTypeQLElement(label_scoped) - Location: (2127,2151)(2127,2151)
+ PsiElement(LABEL_SCOPED_)('compromises:compromising')(2127,2151)
+ PsiElement(',')(',')(2151,2152)
+ PsiWhiteSpace('\n ')(2152,2157)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2157,2190)(2157,2190)
+ PsiElement('plays')('plays')(2157,2162)
+ PsiWhiteSpace(' ')(2162,2163)
+ PsiTypeQLElement(type_scoped) - Location: (2163,2190)(2163,2190)
+ PsiTypeQLElement(label_scoped) - Location: (2163,2190)(2163,2190)
+ PsiElement(LABEL_SCOPED_)('originates-from:originating')(2163,2190)
+ PsiElement(',')(',')(2190,2191)
+ PsiWhiteSpace('\n\n ')(2191,2197)
+ PsiComment(COMMENT)('# RRel\n')(2197,2204)
+ PsiWhiteSpace(' ')(2204,2208)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2208,2233)(2208,2233)
+ PsiElement('plays')('plays')(2208,2213)
+ PsiWhiteSpace(' ')(2213,2214)
+ PsiTypeQLElement(type_scoped) - Location: (2214,2233)(2214,2233)
+ PsiTypeQLElement(label_scoped) - Location: (2214,2233)(2214,2233)
+ PsiElement(LABEL_SCOPED_)('indicates:indicated')(2214,2233)
+ PsiElement(';')(';')(2233,2234)
+ PsiWhiteSpace('\n\n')(2234,2236)
+ PsiTypeQLElement(definable) - Location: (2236,2444)(2236,2444)
+ PsiTypeQLStatementType(statement_type) - Location: (2236,2444)(2236,2444)
+ PsiTypeQLElement(type_any) - Location: (2236,2252)(2236,2252)
+ PsiTypeQLType(type) - Name: course-of-action - Location: (2236,2252)(2236,2252)
+ PsiTypeQLElement(label) - Location: (2236,2252)(2236,2252)
+ PsiElement(LABEL_)('course-of-action')(2236,2252)
+ PsiWhiteSpace(' ')(2252,2253)
+ PsiTypeQLSubType(type_constraint) - Location: (2253,2275)(2253,2275)
+ PsiElement(SUB_)('sub')(2253,2256)
+ PsiWhiteSpace(' ')(2256,2257)
+ PsiTypeQLElement(type_any) - Location: (2257,2275)(2257,2275)
+ PsiTypeQLElement(type) - Location: (2257,2275)(2257,2275)
+ PsiTypeQLElement(label) - Location: (2257,2275)(2257,2275)
+ PsiElement(LABEL_)('stix-domain-object')(2257,2275)
+ PsiElement(',')(',')(2275,2276)
+ PsiWhiteSpace('\n ')(2276,2281)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2281,2290)(2281,2290)
+ PsiElement('owns')('owns')(2281,2285)
+ PsiWhiteSpace(' ')(2285,2286)
+ PsiTypeQLElement(type) - Location: (2286,2290)(2286,2290)
+ PsiTypeQLElement(label) - Location: (2286,2290)(2286,2290)
+ PsiElement(LABEL_)('name')(2286,2290)
+ PsiTypeQLElement(annotations_owns) - Location: (2290,2290)(2290,2290)
+
+ PsiElement(',')(',')(2290,2291)
+ PsiWhiteSpace('\n ')(2291,2296)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2296,2312)(2296,2312)
+ PsiElement('owns')('owns')(2296,2300)
+ PsiWhiteSpace(' ')(2300,2301)
+ PsiTypeQLElement(type) - Location: (2301,2312)(2301,2312)
+ PsiTypeQLElement(label) - Location: (2301,2312)(2301,2312)
+ PsiElement(LABEL_)('description')(2301,2312)
+ PsiTypeQLElement(annotations_owns) - Location: (2312,2312)(2312,2312)
+
+ PsiElement(',')(',')(2312,2313)
+ PsiWhiteSpace('\n ')(2313,2318)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2318,2329)(2318,2329)
+ PsiElement('owns')('owns')(2318,2322)
+ PsiWhiteSpace(' ')(2322,2323)
+ PsiTypeQLElement(type) - Location: (2323,2329)(2323,2329)
+ PsiTypeQLElement(label) - Location: (2323,2329)(2323,2329)
+ PsiElement(LABEL_)('action')(2323,2329)
+ PsiTypeQLElement(annotations_owns) - Location: (2329,2329)(2329,2329)
+
+ PsiElement(',')(',')(2329,2330)
+ PsiWhiteSpace('\n\n ')(2330,2336)
+ PsiComment(COMMENT)('# Rel\n')(2336,2342)
+ PsiWhiteSpace(' ')(2342,2346)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2346,2378)(2346,2378)
+ PsiElement('plays')('plays')(2346,2351)
+ PsiWhiteSpace(' ')(2351,2352)
+ PsiTypeQLElement(type_scoped) - Location: (2352,2378)(2352,2378)
+ PsiTypeQLElement(label_scoped) - Location: (2352,2378)(2352,2378)
+ PsiElement(LABEL_SCOPED_)('investigates:investigating')(2352,2378)
+ PsiElement(',')(',')(2378,2379)
+ PsiWhiteSpace('\n ')(2379,2384)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2384,2410)(2384,2410)
+ PsiElement('plays')('plays')(2384,2389)
+ PsiWhiteSpace(' ')(2389,2390)
+ PsiTypeQLElement(type_scoped) - Location: (2390,2410)(2390,2410)
+ PsiTypeQLElement(label_scoped) - Location: (2390,2410)(2390,2410)
+ PsiElement(LABEL_SCOPED_)('mitigates:mitigating')(2390,2410)
+ PsiElement(',')(',')(2410,2411)
+ PsiWhiteSpace('\n ')(2411,2416)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2416,2444)(2416,2444)
+ PsiElement('plays')('plays')(2416,2421)
+ PsiWhiteSpace(' ')(2421,2422)
+ PsiTypeQLElement(type_scoped) - Location: (2422,2444)(2422,2444)
+ PsiTypeQLElement(label_scoped) - Location: (2422,2444)(2422,2444)
+ PsiElement(LABEL_SCOPED_)('remediates:remediating')(2422,2444)
+ PsiElement(';')(';')(2444,2445)
+ PsiWhiteSpace('\n\n')(2445,2447)
+ PsiTypeQLElement(definable) - Location: (2447,2533)(2447,2533)
+ PsiTypeQLStatementType(statement_type) - Location: (2447,2533)(2447,2533)
+ PsiTypeQLElement(type_any) - Location: (2447,2455)(2447,2455)
+ PsiTypeQLType(type) - Name: grouping - Location: (2447,2455)(2447,2455)
+ PsiTypeQLElement(label) - Location: (2447,2455)(2447,2455)
+ PsiElement(LABEL_)('grouping')(2447,2455)
+ PsiWhiteSpace(' ')(2455,2456)
+ PsiTypeQLSubType(type_constraint) - Location: (2456,2478)(2456,2478)
+ PsiElement(SUB_)('sub')(2456,2459)
+ PsiWhiteSpace(' ')(2459,2460)
+ PsiTypeQLElement(type_any) - Location: (2460,2478)(2460,2478)
+ PsiTypeQLElement(type) - Location: (2460,2478)(2460,2478)
+ PsiTypeQLElement(label) - Location: (2460,2478)(2460,2478)
+ PsiElement(LABEL_)('stix-domain-object')(2460,2478)
+ PsiElement(',')(',')(2478,2479)
+ PsiWhiteSpace('\n ')(2479,2484)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2484,2493)(2484,2493)
+ PsiElement('owns')('owns')(2484,2488)
+ PsiWhiteSpace(' ')(2488,2489)
+ PsiTypeQLElement(type) - Location: (2489,2493)(2489,2493)
+ PsiTypeQLElement(label) - Location: (2489,2493)(2489,2493)
+ PsiElement(LABEL_)('name')(2489,2493)
+ PsiTypeQLElement(annotations_owns) - Location: (2493,2493)(2493,2493)
+
+ PsiElement(',')(',')(2493,2494)
+ PsiWhiteSpace('\n ')(2494,2499)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2499,2515)(2499,2515)
+ PsiElement('owns')('owns')(2499,2503)
+ PsiWhiteSpace(' ')(2503,2504)
+ PsiTypeQLElement(type) - Location: (2504,2515)(2504,2515)
+ PsiTypeQLElement(label) - Location: (2504,2515)(2504,2515)
+ PsiElement(LABEL_)('description')(2504,2515)
+ PsiTypeQLElement(annotations_owns) - Location: (2515,2515)(2515,2515)
+
+ PsiElement(',')(',')(2515,2516)
+ PsiWhiteSpace('\n ')(2516,2521)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2521,2533)(2521,2533)
+ PsiElement('owns')('owns')(2521,2525)
+ PsiWhiteSpace(' ')(2525,2526)
+ PsiTypeQLElement(type) - Location: (2526,2533)(2526,2533)
+ PsiTypeQLElement(label) - Location: (2526,2533)(2526,2533)
+ PsiElement(LABEL_)('context')(2526,2533)
+ PsiTypeQLElement(annotations_owns) - Location: (2533,2533)(2533,2533)
+
+ PsiElement(';')(';')(2533,2534)
+ PsiWhiteSpace('\n\n\n\n')(2534,2538)
+ PsiTypeQLElement(definable) - Location: (2538,2927)(2538,2927)
+ PsiTypeQLStatementType(statement_type) - Location: (2538,2927)(2538,2927)
+ PsiTypeQLElement(type_any) - Location: (2538,2546)(2538,2546)
+ PsiTypeQLType(type) - Name: identity - Location: (2538,2546)(2538,2546)
+ PsiTypeQLElement(label) - Location: (2538,2546)(2538,2546)
+ PsiElement(LABEL_)('identity')(2538,2546)
+ PsiWhiteSpace(' ')(2546,2547)
+ PsiTypeQLSubType(type_constraint) - Location: (2547,2569)(2547,2569)
+ PsiElement(SUB_)('sub')(2547,2550)
+ PsiWhiteSpace(' ')(2550,2551)
+ PsiTypeQLElement(type_any) - Location: (2551,2569)(2551,2569)
+ PsiTypeQLElement(type) - Location: (2551,2569)(2551,2569)
+ PsiTypeQLElement(label) - Location: (2551,2569)(2551,2569)
+ PsiElement(LABEL_)('stix-domain-object')(2551,2569)
+ PsiElement(',')(',')(2569,2570)
+ PsiWhiteSpace('\n ')(2570,2575)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2575,2584)(2575,2584)
+ PsiElement('owns')('owns')(2575,2579)
+ PsiWhiteSpace(' ')(2579,2580)
+ PsiTypeQLElement(type) - Location: (2580,2584)(2580,2584)
+ PsiTypeQLElement(label) - Location: (2580,2584)(2580,2584)
+ PsiElement(LABEL_)('name')(2580,2584)
+ PsiTypeQLElement(annotations_owns) - Location: (2584,2584)(2584,2584)
+
+ PsiElement(',')(',')(2584,2585)
+ PsiWhiteSpace('\n ')(2585,2590)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2590,2606)(2590,2606)
+ PsiElement('owns')('owns')(2590,2594)
+ PsiWhiteSpace(' ')(2594,2595)
+ PsiTypeQLElement(type) - Location: (2595,2606)(2595,2606)
+ PsiTypeQLElement(label) - Location: (2595,2606)(2595,2606)
+ PsiElement(LABEL_)('description')(2595,2606)
+ PsiTypeQLElement(annotations_owns) - Location: (2606,2606)(2606,2606)
+
+ PsiElement(',')(',')(2606,2607)
+ PsiWhiteSpace('\n ')(2607,2612)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2612,2626)(2612,2626)
+ PsiElement('owns')('owns')(2612,2616)
+ PsiWhiteSpace(' ')(2616,2617)
+ PsiTypeQLElement(type) - Location: (2617,2626)(2617,2626)
+ PsiTypeQLElement(label) - Location: (2617,2626)(2617,2626)
+ PsiElement(LABEL_)('stix-role')(2617,2626)
+ PsiTypeQLElement(annotations_owns) - Location: (2626,2626)(2626,2626)
+
+ PsiElement(',')(',')(2626,2627)
+ PsiWhiteSpace('\n ')(2627,2632)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2632,2651)(2632,2651)
+ PsiElement('owns')('owns')(2632,2636)
+ PsiWhiteSpace(' ')(2636,2637)
+ PsiTypeQLElement(type) - Location: (2637,2651)(2637,2651)
+ PsiTypeQLElement(label) - Location: (2637,2651)(2637,2651)
+ PsiElement(LABEL_)('identity-class')(2637,2651)
+ PsiTypeQLElement(annotations_owns) - Location: (2651,2651)(2651,2651)
+
+ PsiElement(',')(',')(2651,2652)
+ PsiWhiteSpace('\n ')(2652,2657)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2657,2668)(2657,2668)
+ PsiElement('owns')('owns')(2657,2661)
+ PsiWhiteSpace(' ')(2661,2662)
+ PsiTypeQLElement(type) - Location: (2662,2668)(2662,2668)
+ PsiTypeQLElement(label) - Location: (2662,2668)(2662,2668)
+ PsiElement(LABEL_)('sector')(2662,2668)
+ PsiTypeQLElement(annotations_owns) - Location: (2668,2668)(2668,2668)
+
+ PsiElement(',')(',')(2668,2669)
+ PsiWhiteSpace('\n ')(2669,2674)
+ PsiTypeQLOwnsType(type_constraint) - Location: (2674,2698)(2674,2698)
+ PsiElement('owns')('owns')(2674,2678)
+ PsiWhiteSpace(' ')(2678,2679)
+ PsiTypeQLElement(type) - Location: (2679,2698)(2679,2698)
+ PsiTypeQLElement(label) - Location: (2679,2698)(2679,2698)
+ PsiElement(LABEL_)('contact-information')(2679,2698)
+ PsiTypeQLElement(annotations_owns) - Location: (2698,2698)(2698,2698)
+
+ PsiElement(',')(',')(2698,2699)
+ PsiWhiteSpace('\n\n ')(2699,2705)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2705,2729)(2705,2729)
+ PsiElement('plays')('plays')(2705,2710)
+ PsiWhiteSpace(' ')(2710,2711)
+ PsiTypeQLElement(type_scoped) - Location: (2711,2729)(2711,2729)
+ PsiTypeQLElement(label_scoped) - Location: (2711,2729)(2711,2729)
+ PsiElement(LABEL_SCOPED_)('created-by:creator')(2711,2729)
+ PsiElement(',')(',')(2729,2730)
+ PsiWhiteSpace('\n\n ')(2730,2736)
+ PsiComment(COMMENT)('# Rel\n')(2736,2742)
+ PsiWhiteSpace(' ')(2742,2746)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2746,2771)(2746,2771)
+ PsiElement('plays')('plays')(2746,2751)
+ PsiWhiteSpace(' ')(2751,2752)
+ PsiTypeQLElement(type_scoped) - Location: (2752,2771)(2752,2771)
+ PsiTypeQLElement(label_scoped) - Location: (2752,2771)(2752,2771)
+ PsiElement(LABEL_SCOPED_)('located-at:locating')(2752,2771)
+ PsiElement(',')(',')(2771,2772)
+ PsiWhiteSpace('\n ')(2772,2777)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2777,2793)(2777,2793)
+ PsiElement('plays')('plays')(2777,2782)
+ PsiWhiteSpace(' ')(2782,2783)
+ PsiTypeQLElement(type_scoped) - Location: (2783,2793)(2783,2793)
+ PsiTypeQLElement(label_scoped) - Location: (2783,2793)(2783,2793)
+ PsiElement(LABEL_SCOPED_)('uses:using')(2783,2793)
+ PsiElement(',')(',')(2793,2794)
+ PsiWhiteSpace('\n\n ')(2794,2800)
+ PsiComment(COMMENT)('# RRel\n')(2800,2807)
+ PsiWhiteSpace(' ')(2807,2811)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2811,2826)(2811,2826)
+ PsiElement('plays')('plays')(2811,2816)
+ PsiWhiteSpace(' ')(2816,2817)
+ PsiTypeQLElement(type_scoped) - Location: (2817,2826)(2817,2826)
+ PsiTypeQLElement(label_scoped) - Location: (2817,2826)(2817,2826)
+ PsiElement(LABEL_SCOPED_)('uses:used')(2817,2826)
+ PsiElement(',')(',')(2826,2827)
+ PsiWhiteSpace('\n ')(2827,2832)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2832,2854)(2832,2854)
+ PsiElement('plays')('plays')(2832,2837)
+ PsiWhiteSpace(' ')(2837,2838)
+ PsiTypeQLElement(type_scoped) - Location: (2838,2854)(2838,2854)
+ PsiTypeQLElement(label_scoped) - Location: (2838,2854)(2838,2854)
+ PsiElement(LABEL_SCOPED_)('targets:targeted')(2838,2854)
+ PsiElement(',')(',')(2854,2855)
+ PsiWhiteSpace('\n ')(2855,2860)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2860,2890)(2860,2890)
+ PsiElement('plays')('plays')(2860,2865)
+ PsiWhiteSpace(' ')(2865,2866)
+ PsiTypeQLElement(type_scoped) - Location: (2866,2890)(2866,2890)
+ PsiTypeQLElement(label_scoped) - Location: (2866,2890)(2866,2890)
+ PsiElement(LABEL_SCOPED_)('attributed-to:attributed')(2866,2890)
+ PsiElement(',')(',')(2890,2891)
+ PsiWhiteSpace('\n ')(2891,2896)
+ PsiTypeQLPlaysType(type_constraint) - Location: (2896,2927)(2896,2927)
+ PsiElement('plays')('plays')(2896,2901)
+ PsiWhiteSpace(' ')(2901,2902)
+ PsiTypeQLElement(type_scoped) - Location: (2902,2927)(2902,2927)
+ PsiTypeQLElement(label_scoped) - Location: (2902,2927)(2902,2927)
+ PsiElement(LABEL_SCOPED_)('impersonates:impersonated')(2902,2927)
+ PsiElement(';')(';')(2927,2928)
+ PsiWhiteSpace('\n\n')(2928,2930)
+ PsiTypeQLElement(definable) - Location: (2930,2953)(2930,2953)
+ PsiTypeQLStatementType(statement_type) - Location: (2930,2953)(2930,2953)
+ PsiTypeQLElement(type_any) - Location: (2930,2940)(2930,2940)
+ PsiTypeQLType(type) - Name: individual - Location: (2930,2940)(2930,2940)
+ PsiTypeQLElement(label) - Location: (2930,2940)(2930,2940)
+ PsiElement(LABEL_)('individual')(2930,2940)
+ PsiWhiteSpace(' ')(2940,2941)
+ PsiTypeQLSubType(type_constraint) - Location: (2941,2953)(2941,2953)
+ PsiElement(SUB_)('sub')(2941,2944)
+ PsiWhiteSpace(' ')(2944,2945)
+ PsiTypeQLElement(type_any) - Location: (2945,2953)(2945,2953)
+ PsiTypeQLElement(type) - Location: (2945,2953)(2945,2953)
+ PsiTypeQLElement(label) - Location: (2945,2953)(2945,2953)
+ PsiElement(LABEL_)('identity')(2945,2953)
+ PsiElement(';')(';')(2953,2954)
+ PsiWhiteSpace('\n')(2954,2955)
+ PsiTypeQLElement(definable) - Location: (2955,2973)(2955,2973)
+ PsiTypeQLStatementType(statement_type) - Location: (2955,2973)(2955,2973)
+ PsiTypeQLElement(type_any) - Location: (2955,2960)(2955,2960)
+ PsiTypeQLType(type) - Name: group - Location: (2955,2960)(2955,2960)
+ PsiTypeQLElement(label) - Location: (2955,2960)(2955,2960)
+ PsiTypeQLElement(unreserved) - Location: (2955,2960)(2955,2960)
+ PsiElement('group')('group')(2955,2960)
+ PsiWhiteSpace(' ')(2960,2961)
+ PsiTypeQLSubType(type_constraint) - Location: (2961,2973)(2961,2973)
+ PsiElement(SUB_)('sub')(2961,2964)
+ PsiWhiteSpace(' ')(2964,2965)
+ PsiTypeQLElement(type_any) - Location: (2965,2973)(2965,2973)
+ PsiTypeQLElement(type) - Location: (2965,2973)(2965,2973)
+ PsiTypeQLElement(label) - Location: (2965,2973)(2965,2973)
+ PsiElement(LABEL_)('identity')(2965,2973)
+ PsiElement(';')(';')(2973,2974)
+ PsiWhiteSpace('\n')(2974,2975)
+ PsiTypeQLElement(definable) - Location: (2975,2994)(2975,2994)
+ PsiTypeQLStatementType(statement_type) - Location: (2975,2994)(2975,2994)
+ PsiTypeQLElement(type_any) - Location: (2975,2981)(2975,2981)
+ PsiTypeQLType(type) - Name: system - Location: (2975,2981)(2975,2981)
+ PsiTypeQLElement(label) - Location: (2975,2981)(2975,2981)
+ PsiElement(LABEL_)('system')(2975,2981)
+ PsiWhiteSpace(' ')(2981,2982)
+ PsiTypeQLSubType(type_constraint) - Location: (2982,2994)(2982,2994)
+ PsiElement(SUB_)('sub')(2982,2985)
+ PsiWhiteSpace(' ')(2985,2986)
+ PsiTypeQLElement(type_any) - Location: (2986,2994)(2986,2994)
+ PsiTypeQLElement(type) - Location: (2986,2994)(2986,2994)
+ PsiTypeQLElement(label) - Location: (2986,2994)(2986,2994)
+ PsiElement(LABEL_)('identity')(2986,2994)
+ PsiElement(';')(';')(2994,2995)
+ PsiWhiteSpace('\n')(2995,2996)
+ PsiTypeQLElement(definable) - Location: (2996,3021)(2996,3021)
+ PsiTypeQLStatementType(statement_type) - Location: (2996,3021)(2996,3021)
+ PsiTypeQLElement(type_any) - Location: (2996,3008)(2996,3008)
+ PsiTypeQLType(type) - Name: organization - Location: (2996,3008)(2996,3008)
+ PsiTypeQLElement(label) - Location: (2996,3008)(2996,3008)
+ PsiElement(LABEL_)('organization')(2996,3008)
+ PsiWhiteSpace(' ')(3008,3009)
+ PsiTypeQLSubType(type_constraint) - Location: (3009,3021)(3009,3021)
+ PsiElement(SUB_)('sub')(3009,3012)
+ PsiWhiteSpace(' ')(3012,3013)
+ PsiTypeQLElement(type_any) - Location: (3013,3021)(3013,3021)
+ PsiTypeQLElement(type) - Location: (3013,3021)(3013,3021)
+ PsiTypeQLElement(label) - Location: (3013,3021)(3013,3021)
+ PsiElement(LABEL_)('identity')(3013,3021)
+ PsiElement(';')(';')(3021,3022)
+ PsiWhiteSpace('\n')(3022,3023)
+ PsiTypeQLElement(definable) - Location: (3023,3041)(3023,3041)
+ PsiTypeQLStatementType(statement_type) - Location: (3023,3041)(3023,3041)
+ PsiTypeQLElement(type_any) - Location: (3023,3028)(3023,3028)
+ PsiTypeQLType(type) - Name: class - Location: (3023,3028)(3023,3028)
+ PsiTypeQLElement(label) - Location: (3023,3028)(3023,3028)
+ PsiElement(LABEL_)('class')(3023,3028)
+ PsiWhiteSpace(' ')(3028,3029)
+ PsiTypeQLSubType(type_constraint) - Location: (3029,3041)(3029,3041)
+ PsiElement(SUB_)('sub')(3029,3032)
+ PsiWhiteSpace(' ')(3032,3033)
+ PsiTypeQLElement(type_any) - Location: (3033,3041)(3033,3041)
+ PsiTypeQLElement(type) - Location: (3033,3041)(3033,3041)
+ PsiTypeQLElement(label) - Location: (3033,3041)(3033,3041)
+ PsiElement(LABEL_)('identity')(3033,3041)
+ PsiElement(';')(';')(3041,3042)
+ PsiWhiteSpace('\n')(3042,3043)
+ PsiTypeQLElement(definable) - Location: (3043,3066)(3043,3066)
+ PsiTypeQLStatementType(statement_type) - Location: (3043,3066)(3043,3066)
+ PsiTypeQLElement(type_any) - Location: (3043,3053)(3043,3053)
+ PsiTypeQLType(type) - Name: id-unknown - Location: (3043,3053)(3043,3053)
+ PsiTypeQLElement(label) - Location: (3043,3053)(3043,3053)
+ PsiElement(LABEL_)('id-unknown')(3043,3053)
+ PsiWhiteSpace(' ')(3053,3054)
+ PsiTypeQLSubType(type_constraint) - Location: (3054,3066)(3054,3066)
+ PsiElement(SUB_)('sub')(3054,3057)
+ PsiWhiteSpace(' ')(3057,3058)
+ PsiTypeQLElement(type_any) - Location: (3058,3066)(3058,3066)
+ PsiTypeQLElement(type) - Location: (3058,3066)(3058,3066)
+ PsiTypeQLElement(label) - Location: (3058,3066)(3058,3066)
+ PsiElement(LABEL_)('identity')(3058,3066)
+ PsiElement(';')(';')(3066,3067)
+ PsiWhiteSpace('\n\n')(3067,3069)
+ PsiTypeQLElement(definable) - Location: (3069,3137)(3069,3137)
+ PsiTypeQLStatementType(statement_type) - Location: (3069,3137)(3069,3137)
+ PsiTypeQLElement(type_any) - Location: (3069,3077)(3069,3077)
+ PsiTypeQLType(type) - Name: incident - Location: (3069,3077)(3069,3077)
+ PsiTypeQLElement(label) - Location: (3069,3077)(3069,3077)
+ PsiElement(LABEL_)('incident')(3069,3077)
+ PsiWhiteSpace(' ')(3077,3078)
+ PsiTypeQLSubType(type_constraint) - Location: (3078,3100)(3078,3100)
+ PsiElement(SUB_)('sub')(3078,3081)
+ PsiWhiteSpace(' ')(3081,3082)
+ PsiTypeQLElement(type_any) - Location: (3082,3100)(3082,3100)
+ PsiTypeQLElement(type) - Location: (3082,3100)(3082,3100)
+ PsiTypeQLElement(label) - Location: (3082,3100)(3082,3100)
+ PsiElement(LABEL_)('stix-domain-object')(3082,3100)
+ PsiElement(',')(',')(3100,3101)
+ PsiWhiteSpace('\n ')(3101,3106)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3106,3115)(3106,3115)
+ PsiElement('owns')('owns')(3106,3110)
+ PsiWhiteSpace(' ')(3110,3111)
+ PsiTypeQLElement(type) - Location: (3111,3115)(3111,3115)
+ PsiTypeQLElement(label) - Location: (3111,3115)(3111,3115)
+ PsiElement(LABEL_)('name')(3111,3115)
+ PsiTypeQLElement(annotations_owns) - Location: (3115,3115)(3115,3115)
+
+ PsiElement(',')(',')(3115,3116)
+ PsiWhiteSpace('\n ')(3116,3121)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3121,3137)(3121,3137)
+ PsiElement('owns')('owns')(3121,3125)
+ PsiWhiteSpace(' ')(3125,3126)
+ PsiTypeQLElement(type) - Location: (3126,3137)(3126,3137)
+ PsiTypeQLElement(label) - Location: (3126,3137)(3126,3137)
+ PsiElement(LABEL_)('description')(3126,3137)
+ PsiTypeQLElement(annotations_owns) - Location: (3137,3137)(3137,3137)
+
+ PsiElement(';')(';')(3137,3138)
+ PsiWhiteSpace('\n\n')(3138,3140)
+ PsiTypeQLElement(definable) - Location: (3140,3494)(3140,3494)
+ PsiTypeQLStatementType(statement_type) - Location: (3140,3494)(3140,3494)
+ PsiTypeQLElement(type_any) - Location: (3140,3149)(3140,3149)
+ PsiTypeQLType(type) - Name: indicator - Location: (3140,3149)(3140,3149)
+ PsiTypeQLElement(label) - Location: (3140,3149)(3140,3149)
+ PsiElement(LABEL_)('indicator')(3140,3149)
+ PsiWhiteSpace(' ')(3149,3150)
+ PsiTypeQLSubType(type_constraint) - Location: (3150,3172)(3150,3172)
+ PsiElement(SUB_)('sub')(3150,3153)
+ PsiWhiteSpace(' ')(3153,3154)
+ PsiTypeQLElement(type_any) - Location: (3154,3172)(3154,3172)
+ PsiTypeQLElement(type) - Location: (3154,3172)(3154,3172)
+ PsiTypeQLElement(label) - Location: (3154,3172)(3154,3172)
+ PsiElement(LABEL_)('stix-domain-object')(3154,3172)
+ PsiElement(',')(',')(3172,3173)
+ PsiWhiteSpace('\n ')(3173,3178)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3178,3187)(3178,3187)
+ PsiElement('owns')('owns')(3178,3182)
+ PsiWhiteSpace(' ')(3182,3183)
+ PsiTypeQLElement(type) - Location: (3183,3187)(3183,3187)
+ PsiTypeQLElement(label) - Location: (3183,3187)(3183,3187)
+ PsiElement(LABEL_)('name')(3183,3187)
+ PsiTypeQLElement(annotations_owns) - Location: (3187,3187)(3187,3187)
+
+ PsiElement(',')(',')(3187,3188)
+ PsiWhiteSpace('\n ')(3188,3193)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3193,3209)(3193,3209)
+ PsiElement('owns')('owns')(3193,3197)
+ PsiWhiteSpace(' ')(3197,3198)
+ PsiTypeQLElement(type) - Location: (3198,3209)(3198,3209)
+ PsiTypeQLElement(label) - Location: (3198,3209)(3198,3209)
+ PsiElement(LABEL_)('description')(3198,3209)
+ PsiTypeQLElement(annotations_owns) - Location: (3209,3209)(3209,3209)
+
+ PsiElement(',')(',')(3209,3210)
+ PsiWhiteSpace('\n ')(3210,3215)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3215,3234)(3215,3234)
+ PsiElement('owns')('owns')(3215,3219)
+ PsiWhiteSpace(' ')(3219,3220)
+ PsiTypeQLElement(type) - Location: (3220,3234)(3220,3234)
+ PsiTypeQLElement(label) - Location: (3220,3234)(3220,3234)
+ PsiElement(LABEL_)('indicator-type')(3220,3234)
+ PsiTypeQLElement(annotations_owns) - Location: (3234,3234)(3234,3234)
+
+ PsiElement(',')(',')(3234,3235)
+ PsiWhiteSpace('\n ')(3235,3240)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3240,3252)(3240,3252)
+ PsiElement('owns')('owns')(3240,3244)
+ PsiWhiteSpace(' ')(3244,3245)
+ PsiTypeQLElement(type) - Location: (3245,3252)(3245,3252)
+ PsiTypeQLElement(label) - Location: (3245,3252)(3245,3252)
+ PsiElement(LABEL_)('pattern')(3245,3252)
+ PsiTypeQLElement(annotations_owns) - Location: (3252,3252)(3252,3252)
+
+ PsiElement(',')(',')(3252,3253)
+ PsiWhiteSpace('\n ')(3253,3258)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3258,3275)(3258,3275)
+ PsiElement('owns')('owns')(3258,3262)
+ PsiWhiteSpace(' ')(3262,3263)
+ PsiTypeQLElement(type) - Location: (3263,3275)(3263,3275)
+ PsiTypeQLElement(label) - Location: (3263,3275)(3263,3275)
+ PsiElement(LABEL_)('pattern-type')(3263,3275)
+ PsiTypeQLElement(annotations_owns) - Location: (3275,3275)(3275,3275)
+
+ PsiElement(',')(',')(3275,3276)
+ PsiWhiteSpace('\n ')(3276,3281)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3281,3301)(3281,3301)
+ PsiElement('owns')('owns')(3281,3285)
+ PsiWhiteSpace(' ')(3285,3286)
+ PsiTypeQLElement(type) - Location: (3286,3301)(3286,3301)
+ PsiTypeQLElement(label) - Location: (3286,3301)(3286,3301)
+ PsiElement(LABEL_)('pattern-version')(3286,3301)
+ PsiTypeQLElement(annotations_owns) - Location: (3301,3301)(3301,3301)
+
+ PsiElement(',')(',')(3301,3302)
+ PsiWhiteSpace('\n ')(3302,3307)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3307,3322)(3307,3322)
+ PsiElement('owns')('owns')(3307,3311)
+ PsiWhiteSpace(' ')(3311,3312)
+ PsiTypeQLElement(type) - Location: (3312,3322)(3312,3322)
+ PsiTypeQLElement(label) - Location: (3312,3322)(3312,3322)
+ PsiElement(LABEL_)('valid-from')(3312,3322)
+ PsiTypeQLElement(annotations_owns) - Location: (3322,3322)(3322,3322)
+
+ PsiElement(',')(',')(3322,3323)
+ PsiWhiteSpace('\n ')(3323,3328)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3328,3344)(3328,3344)
+ PsiElement('owns')('owns')(3328,3332)
+ PsiWhiteSpace(' ')(3332,3333)
+ PsiTypeQLElement(type) - Location: (3333,3344)(3333,3344)
+ PsiTypeQLElement(label) - Location: (3333,3344)(3333,3344)
+ PsiElement(LABEL_)('valid-until')(3333,3344)
+ PsiTypeQLElement(annotations_owns) - Location: (3344,3344)(3344,3344)
+
+ PsiElement(',')(',')(3344,3345)
+ PsiWhiteSpace('\n\n ')(3345,3351)
+ PsiComment(COMMENT)('# Rel\n')(3351,3357)
+ PsiWhiteSpace(' ')(3357,3361)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3361,3387)(3361,3387)
+ PsiElement('plays')('plays')(3361,3366)
+ PsiWhiteSpace(' ')(3366,3367)
+ PsiTypeQLElement(type_scoped) - Location: (3367,3387)(3367,3387)
+ PsiTypeQLElement(label_scoped) - Location: (3367,3387)(3367,3387)
+ PsiElement(LABEL_SCOPED_)('indicates:indicating')(3367,3387)
+ PsiElement(',')(',')(3387,3388)
+ PsiWhiteSpace('\n ')(3388,3393)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3393,3414)(3393,3414)
+ PsiElement('plays')('plays')(3393,3398)
+ PsiWhiteSpace(' ')(3398,3399)
+ PsiTypeQLElement(type_scoped) - Location: (3399,3414)(3399,3414)
+ PsiTypeQLElement(label_scoped) - Location: (3399,3414)(3399,3414)
+ PsiElement(LABEL_SCOPED_)('based-on:basing')(3399,3414)
+ PsiElement(',')(',')(3414,3415)
+ PsiWhiteSpace('\n\n ')(3415,3421)
+ PsiComment(COMMENT)('# RRel\n')(3421,3428)
+ PsiWhiteSpace(' ')(3428,3432)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3432,3463)(3432,3463)
+ PsiElement('plays')('plays')(3432,3437)
+ PsiWhiteSpace(' ')(3437,3438)
+ PsiTypeQLElement(type_scoped) - Location: (3438,3463)(3438,3463)
+ PsiTypeQLElement(label_scoped) - Location: (3438,3463)(3438,3463)
+ PsiElement(LABEL_SCOPED_)('investigates:investigated')(3438,3463)
+ PsiElement(',')(',')(3463,3464)
+ PsiWhiteSpace('\n ')(3464,3469)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3469,3494)(3469,3494)
+ PsiElement('plays')('plays')(3469,3474)
+ PsiWhiteSpace(' ')(3474,3475)
+ PsiTypeQLElement(type_scoped) - Location: (3475,3494)(3475,3494)
+ PsiTypeQLElement(label_scoped) - Location: (3475,3494)(3475,3494)
+ PsiElement(LABEL_SCOPED_)('mitigates:mitigated')(3475,3494)
+ PsiElement(';')(';')(3494,3495)
+ PsiWhiteSpace('\n\n')(3495,3497)
+ PsiTypeQLElement(definable) - Location: (3497,4239)(3497,4239)
+ PsiTypeQLStatementType(statement_type) - Location: (3497,4239)(3497,4239)
+ PsiTypeQLElement(type_any) - Location: (3497,3511)(3497,3511)
+ PsiTypeQLType(type) - Name: infrastructure - Location: (3497,3511)(3497,3511)
+ PsiTypeQLElement(label) - Location: (3497,3511)(3497,3511)
+ PsiElement(LABEL_)('infrastructure')(3497,3511)
+ PsiWhiteSpace(' ')(3511,3512)
+ PsiTypeQLSubType(type_constraint) - Location: (3512,3534)(3512,3534)
+ PsiElement(SUB_)('sub')(3512,3515)
+ PsiWhiteSpace(' ')(3515,3516)
+ PsiTypeQLElement(type_any) - Location: (3516,3534)(3516,3534)
+ PsiTypeQLElement(type) - Location: (3516,3534)(3516,3534)
+ PsiTypeQLElement(label) - Location: (3516,3534)(3516,3534)
+ PsiElement(LABEL_)('stix-domain-object')(3516,3534)
+ PsiElement(',')(',')(3534,3535)
+ PsiWhiteSpace('\n ')(3535,3540)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3540,3549)(3540,3549)
+ PsiElement('owns')('owns')(3540,3544)
+ PsiWhiteSpace(' ')(3544,3545)
+ PsiTypeQLElement(type) - Location: (3545,3549)(3545,3549)
+ PsiTypeQLElement(label) - Location: (3545,3549)(3545,3549)
+ PsiElement(LABEL_)('name')(3545,3549)
+ PsiTypeQLElement(annotations_owns) - Location: (3549,3549)(3549,3549)
+
+ PsiElement(',')(',')(3549,3550)
+ PsiWhiteSpace('\n ')(3550,3555)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3555,3571)(3555,3571)
+ PsiElement('owns')('owns')(3555,3559)
+ PsiWhiteSpace(' ')(3559,3560)
+ PsiTypeQLElement(type) - Location: (3560,3571)(3560,3571)
+ PsiTypeQLElement(label) - Location: (3560,3571)(3560,3571)
+ PsiElement(LABEL_)('description')(3560,3571)
+ PsiTypeQLElement(annotations_owns) - Location: (3571,3571)(3571,3571)
+
+ PsiElement(',')(',')(3571,3572)
+ PsiWhiteSpace('\n ')(3572,3577)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3577,3602)(3577,3602)
+ PsiElement('owns')('owns')(3577,3581)
+ PsiWhiteSpace(' ')(3581,3582)
+ PsiTypeQLElement(type) - Location: (3582,3602)(3582,3602)
+ PsiTypeQLElement(label) - Location: (3582,3602)(3582,3602)
+ PsiElement(LABEL_)('infrastructure-types')(3582,3602)
+ PsiTypeQLElement(annotations_owns) - Location: (3602,3602)(3602,3602)
+
+ PsiElement(',')(',')(3602,3603)
+ PsiWhiteSpace('\n ')(3603,3608)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3608,3620)(3608,3620)
+ PsiElement('owns')('owns')(3608,3612)
+ PsiWhiteSpace(' ')(3612,3613)
+ PsiTypeQLElement(type) - Location: (3613,3620)(3613,3620)
+ PsiTypeQLElement(label) - Location: (3613,3620)(3613,3620)
+ PsiElement(LABEL_)('aliases')(3613,3620)
+ PsiTypeQLElement(annotations_owns) - Location: (3620,3620)(3620,3620)
+
+ PsiElement(',')(',')(3620,3621)
+ PsiWhiteSpace('\n ')(3621,3626)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3626,3641)(3626,3641)
+ PsiElement('owns')('owns')(3626,3630)
+ PsiWhiteSpace(' ')(3630,3631)
+ PsiTypeQLElement(type) - Location: (3631,3641)(3631,3641)
+ PsiTypeQLElement(label) - Location: (3631,3641)(3631,3641)
+ PsiElement(LABEL_)('first-seen')(3631,3641)
+ PsiTypeQLElement(annotations_owns) - Location: (3641,3641)(3641,3641)
+
+ PsiElement(',')(',')(3641,3642)
+ PsiWhiteSpace('\n ')(3642,3647)
+ PsiTypeQLOwnsType(type_constraint) - Location: (3647,3661)(3647,3661)
+ PsiElement('owns')('owns')(3647,3651)
+ PsiWhiteSpace(' ')(3651,3652)
+ PsiTypeQLElement(type) - Location: (3652,3661)(3652,3661)
+ PsiTypeQLElement(label) - Location: (3652,3661)(3652,3661)
+ PsiElement(LABEL_)('last-seen')(3652,3661)
+ PsiTypeQLElement(annotations_owns) - Location: (3661,3661)(3661,3661)
+
+ PsiElement(',')(',')(3661,3662)
+ PsiWhiteSpace('\n\n ')(3662,3668)
+ PsiComment(COMMENT)('# Rel\n')(3668,3674)
+ PsiWhiteSpace(' ')(3674,3678)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3678,3703)(3678,3703)
+ PsiElement('plays')('plays')(3678,3683)
+ PsiWhiteSpace(' ')(3683,3684)
+ PsiTypeQLElement(type_scoped) - Location: (3684,3703)(3684,3703)
+ PsiTypeQLElement(label_scoped) - Location: (3684,3703)(3684,3703)
+ PsiElement(LABEL_SCOPED_)('delivers:delivering')(3684,3703)
+ PsiElement(',')(',')(3703,3704)
+ PsiWhiteSpace('\n ')(3704,3709)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3709,3725)(3709,3725)
+ PsiElement('plays')('plays')(3709,3714)
+ PsiWhiteSpace(' ')(3714,3715)
+ PsiTypeQLElement(type_scoped) - Location: (3715,3725)(3715,3725)
+ PsiTypeQLElement(label_scoped) - Location: (3715,3725)(3715,3725)
+ PsiElement(LABEL_SCOPED_)('uses:using')(3715,3725)
+ PsiElement(',')(',')(3725,3726)
+ PsiWhiteSpace('\n ')(3726,3731)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3731,3756)(3731,3756)
+ PsiElement('plays')('plays')(3731,3736)
+ PsiWhiteSpace(' ')(3736,3737)
+ PsiTypeQLElement(type_scoped) - Location: (3737,3756)(3737,3756)
+ PsiTypeQLElement(label_scoped) - Location: (3737,3756)(3737,3756)
+ PsiElement(LABEL_SCOPED_)('located-at:locating')(3737,3756)
+ PsiElement(',')(',')(3756,3757)
+ PsiWhiteSpace('\n ')(3757,3762)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3762,3799)(3762,3799)
+ PsiElement('plays')('plays')(3762,3767)
+ PsiWhiteSpace(' ')(3767,3768)
+ PsiTypeQLElement(type_scoped) - Location: (3768,3799)(3768,3799)
+ PsiTypeQLElement(label_scoped) - Location: (3768,3799)(3768,3799)
+ PsiElement(LABEL_SCOPED_)('communicates-with:communicating')(3768,3799)
+ PsiElement(',')(',')(3799,3800)
+ PsiWhiteSpace('\n ')(3800,3805)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3805,3832)(3805,3832)
+ PsiElement('plays')('plays')(3805,3810)
+ PsiWhiteSpace(' ')(3810,3811)
+ PsiTypeQLElement(type_scoped) - Location: (3811,3832)(3811,3832)
+ PsiTypeQLElement(label_scoped) - Location: (3811,3832)(3811,3832)
+ PsiElement(LABEL_SCOPED_)('consist-of:consisting')(3811,3832)
+ PsiElement(',')(',')(3832,3833)
+ PsiWhiteSpace('\n ')(3833,3838)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3838,3864)(3838,3864)
+ PsiElement('plays')('plays')(3838,3843)
+ PsiWhiteSpace(' ')(3843,3844)
+ PsiTypeQLElement(type_scoped) - Location: (3844,3864)(3844,3864)
+ PsiTypeQLElement(label_scoped) - Location: (3844,3864)(3844,3864)
+ PsiElement(LABEL_SCOPED_)('controls:controlling')(3844,3864)
+ PsiElement(',')(',')(3864,3865)
+ PsiWhiteSpace('\n ')(3865,3870)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3870,3887)(3870,3887)
+ PsiElement('plays')('plays')(3870,3875)
+ PsiWhiteSpace(' ')(3875,3876)
+ PsiTypeQLElement(type_scoped) - Location: (3876,3887)(3876,3887)
+ PsiTypeQLElement(label_scoped) - Location: (3876,3887)(3876,3887)
+ PsiElement(LABEL_SCOPED_)('have:having')(3876,3887)
+ PsiElement(',')(',')(3887,3888)
+ PsiWhiteSpace('\n ')(3888,3893)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3893,3912)(3893,3912)
+ PsiElement('plays')('plays')(3893,3898)
+ PsiWhiteSpace(' ')(3898,3899)
+ PsiTypeQLElement(type_scoped) - Location: (3899,3912)(3899,3912)
+ PsiTypeQLElement(label_scoped) - Location: (3899,3912)(3899,3912)
+ PsiElement(LABEL_SCOPED_)('hosts:hosting')(3899,3912)
+ PsiElement(',')(',')(3912,3913)
+ PsiWhiteSpace('\n\n ')(3913,3919)
+ PsiComment(COMMENT)('# RRel\n')(3919,3926)
+ PsiWhiteSpace(' ')(3926,3930)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3930,3955)(3930,3955)
+ PsiElement('plays')('plays')(3930,3935)
+ PsiWhiteSpace(' ')(3935,3936)
+ PsiTypeQLElement(type_scoped) - Location: (3936,3955)(3936,3955)
+ PsiTypeQLElement(label_scoped) - Location: (3936,3955)(3936,3955)
+ PsiElement(LABEL_SCOPED_)('controls:controlled')(3936,3955)
+ PsiElement(',')(',')(3955,3956)
+ PsiWhiteSpace('\n ')(3956,3961)
+ PsiTypeQLPlaysType(type_constraint) - Location: (3961,3997)(3961,3997)
+ PsiElement('plays')('plays')(3961,3966)
+ PsiWhiteSpace(' ')(3966,3967)
+ PsiTypeQLElement(type_scoped) - Location: (3967,3997)(3967,3997)
+ PsiTypeQLElement(label_scoped) - Location: (3967,3997)(3967,3997)
+ PsiElement(LABEL_SCOPED_)('communicates-with:communicated')(3967,3997)
+ PsiElement(',')(',')(3997,3998)
+ PsiWhiteSpace('\n ')(3998,4003)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4003,4032)(4003,4032)
+ PsiElement('plays')('plays')(4003,4008)
+ PsiWhiteSpace(' ')(4008,4009)
+ PsiTypeQLElement(type_scoped) - Location: (4009,4032)(4009,4032)
+ PsiTypeQLElement(label_scoped) - Location: (4009,4032)(4009,4032)
+ PsiElement(LABEL_SCOPED_)('compromises:compromised')(4009,4032)
+ PsiElement(',')(',')(4032,4033)
+ PsiWhiteSpace('\n ')(4033,4038)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4038,4063)(4038,4063)
+ PsiElement('plays')('plays')(4038,4043)
+ PsiWhiteSpace(' ')(4043,4044)
+ PsiTypeQLElement(type_scoped) - Location: (4044,4063)(4044,4063)
+ PsiTypeQLElement(label_scoped) - Location: (4044,4063)(4044,4063)
+ PsiElement(LABEL_SCOPED_)('indicates:indicated')(4044,4063)
+ PsiElement(',')(',')(4063,4064)
+ PsiWhiteSpace('\n ')(4064,4069)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4069,4084)(4069,4084)
+ PsiElement('plays')('plays')(4069,4074)
+ PsiWhiteSpace(' ')(4074,4075)
+ PsiTypeQLElement(type_scoped) - Location: (4075,4084)(4075,4084)
+ PsiTypeQLElement(label_scoped) - Location: (4075,4084)(4075,4084)
+ PsiElement(LABEL_SCOPED_)('uses:used')(4075,4084)
+ PsiElement(',')(',')(4084,4085)
+ PsiWhiteSpace('\n ')(4085,4090)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4090,4112)(4090,4112)
+ PsiElement('plays')('plays')(4090,4095)
+ PsiWhiteSpace(' ')(4095,4096)
+ PsiTypeQLElement(type_scoped) - Location: (4096,4112)(4096,4112)
+ PsiTypeQLElement(label_scoped) - Location: (4096,4112)(4096,4112)
+ PsiElement(LABEL_SCOPED_)('targets:targeted')(4096,4112)
+ PsiElement(',')(',')(4112,4113)
+ PsiWhiteSpace('\n ')(4113,4118)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4118,4136)(4118,4136)
+ PsiElement('plays')('plays')(4118,4123)
+ PsiWhiteSpace(' ')(4123,4124)
+ PsiTypeQLElement(type_scoped) - Location: (4124,4136)(4124,4136)
+ PsiTypeQLElement(label_scoped) - Location: (4124,4136)(4124,4136)
+ PsiElement(LABEL_SCOPED_)('hosts:hosted')(4124,4136)
+ PsiElement(',')(',')(4136,4137)
+ PsiWhiteSpace('\n ')(4137,4142)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4142,4170)(4142,4170)
+ PsiElement('plays')('plays')(4142,4147)
+ PsiWhiteSpace(' ')(4147,4148)
+ PsiTypeQLElement(type_scoped) - Location: (4148,4170)(4148,4170)
+ PsiTypeQLElement(label_scoped) - Location: (4148,4170)(4148,4170)
+ PsiElement(LABEL_SCOPED_)('beacons-to:beaconed-to')(4148,4170)
+ PsiElement(',')(',')(4170,4171)
+ PsiWhiteSpace('\n ')(4171,4176)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4176,4211)(4176,4211)
+ PsiElement('plays')('plays')(4176,4181)
+ PsiWhiteSpace(' ')(4181,4182)
+ PsiTypeQLElement(type_scoped) - Location: (4182,4211)(4182,4211)
+ PsiTypeQLElement(label_scoped) - Location: (4182,4211)(4182,4211)
+ PsiElement(LABEL_SCOPED_)('exfiltrates-to:exfiltrated-to')(4182,4211)
+ PsiElement(',')(',')(4211,4212)
+ PsiWhiteSpace('\n ')(4212,4217)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4217,4239)(4217,4239)
+ PsiElement('plays')('plays')(4217,4222)
+ PsiWhiteSpace(' ')(4222,4223)
+ PsiTypeQLElement(type_scoped) - Location: (4223,4239)(4223,4239)
+ PsiTypeQLElement(label_scoped) - Location: (4223,4239)(4223,4239)
+ PsiElement(LABEL_SCOPED_)('ownerships:owned')(4223,4239)
+ PsiElement(';')(';')(4239,4240)
+ PsiWhiteSpace('\n\n')(4240,4242)
+ PsiTypeQLElement(definable) - Location: (4242,4840)(4242,4840)
+ PsiTypeQLStatementType(statement_type) - Location: (4242,4840)(4242,4840)
+ PsiTypeQLElement(type_any) - Location: (4242,4255)(4242,4255)
+ PsiTypeQLType(type) - Name: intrusion-set - Location: (4242,4255)(4242,4255)
+ PsiTypeQLElement(label) - Location: (4242,4255)(4242,4255)
+ PsiElement(LABEL_)('intrusion-set')(4242,4255)
+ PsiWhiteSpace(' ')(4255,4256)
+ PsiTypeQLSubType(type_constraint) - Location: (4256,4278)(4256,4278)
+ PsiElement(SUB_)('sub')(4256,4259)
+ PsiWhiteSpace(' ')(4259,4260)
+ PsiTypeQLElement(type_any) - Location: (4260,4278)(4260,4278)
+ PsiTypeQLElement(type) - Location: (4260,4278)(4260,4278)
+ PsiTypeQLElement(label) - Location: (4260,4278)(4260,4278)
+ PsiElement(LABEL_)('stix-domain-object')(4260,4278)
+ PsiElement(',')(',')(4278,4279)
+ PsiWhiteSpace('\n ')(4279,4284)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4284,4293)(4284,4293)
+ PsiElement('owns')('owns')(4284,4288)
+ PsiWhiteSpace(' ')(4288,4289)
+ PsiTypeQLElement(type) - Location: (4289,4293)(4289,4293)
+ PsiTypeQLElement(label) - Location: (4289,4293)(4289,4293)
+ PsiElement(LABEL_)('name')(4289,4293)
+ PsiTypeQLElement(annotations_owns) - Location: (4293,4293)(4293,4293)
+
+ PsiElement(',')(',')(4293,4294)
+ PsiWhiteSpace('\n ')(4294,4299)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4299,4315)(4299,4315)
+ PsiElement('owns')('owns')(4299,4303)
+ PsiWhiteSpace(' ')(4303,4304)
+ PsiTypeQLElement(type) - Location: (4304,4315)(4304,4315)
+ PsiTypeQLElement(label) - Location: (4304,4315)(4304,4315)
+ PsiElement(LABEL_)('description')(4304,4315)
+ PsiTypeQLElement(annotations_owns) - Location: (4315,4315)(4315,4315)
+
+ PsiElement(',')(',')(4315,4316)
+ PsiWhiteSpace('\n ')(4316,4321)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4321,4333)(4321,4333)
+ PsiElement('owns')('owns')(4321,4325)
+ PsiWhiteSpace(' ')(4325,4326)
+ PsiTypeQLElement(type) - Location: (4326,4333)(4326,4333)
+ PsiTypeQLElement(label) - Location: (4326,4333)(4326,4333)
+ PsiElement(LABEL_)('aliases')(4326,4333)
+ PsiTypeQLElement(annotations_owns) - Location: (4333,4333)(4333,4333)
+
+ PsiElement(',')(',')(4333,4334)
+ PsiWhiteSpace('\n ')(4334,4339)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4339,4354)(4339,4354)
+ PsiElement('owns')('owns')(4339,4343)
+ PsiWhiteSpace(' ')(4343,4344)
+ PsiTypeQLElement(type) - Location: (4344,4354)(4344,4354)
+ PsiTypeQLElement(label) - Location: (4344,4354)(4344,4354)
+ PsiElement(LABEL_)('first-seen')(4344,4354)
+ PsiTypeQLElement(annotations_owns) - Location: (4354,4354)(4354,4354)
+
+ PsiElement(',')(',')(4354,4355)
+ PsiWhiteSpace('\n ')(4355,4360)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4360,4374)(4360,4374)
+ PsiElement('owns')('owns')(4360,4364)
+ PsiWhiteSpace(' ')(4364,4365)
+ PsiTypeQLElement(type) - Location: (4365,4374)(4365,4374)
+ PsiTypeQLElement(label) - Location: (4365,4374)(4365,4374)
+ PsiElement(LABEL_)('last-seen')(4365,4374)
+ PsiTypeQLElement(annotations_owns) - Location: (4374,4374)(4374,4374)
+
+ PsiElement(',')(',')(4374,4375)
+ PsiWhiteSpace('\n ')(4375,4380)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4380,4390)(4380,4390)
+ PsiElement('owns')('owns')(4380,4384)
+ PsiWhiteSpace(' ')(4384,4385)
+ PsiTypeQLElement(type) - Location: (4385,4390)(4385,4390)
+ PsiTypeQLElement(label) - Location: (4385,4390)(4385,4390)
+ PsiElement(LABEL_)('goals')(4385,4390)
+ PsiTypeQLElement(annotations_owns) - Location: (4390,4390)(4390,4390)
+
+ PsiElement(',')(',')(4390,4391)
+ PsiWhiteSpace('\n ')(4391,4396)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4396,4415)(4396,4415)
+ PsiElement('owns')('owns')(4396,4400)
+ PsiWhiteSpace(' ')(4400,4401)
+ PsiTypeQLElement(type) - Location: (4401,4415)(4401,4415)
+ PsiTypeQLElement(label) - Location: (4401,4415)(4401,4415)
+ PsiElement(LABEL_)('sophistication')(4401,4415)
+ PsiTypeQLElement(annotations_owns) - Location: (4415,4415)(4415,4415)
+
+ PsiElement(',')(',')(4415,4416)
+ PsiWhiteSpace('\n ')(4416,4421)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4421,4440)(4421,4440)
+ PsiElement('owns')('owns')(4421,4425)
+ PsiWhiteSpace(' ')(4425,4426)
+ PsiTypeQLElement(type) - Location: (4426,4440)(4426,4440)
+ PsiTypeQLElement(label) - Location: (4426,4440)(4426,4440)
+ PsiElement(LABEL_)('resource-level')(4426,4440)
+ PsiTypeQLElement(annotations_owns) - Location: (4440,4440)(4440,4440)
+
+ PsiElement(',')(',')(4440,4441)
+ PsiWhiteSpace('\n ')(4441,4446)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4446,4469)(4446,4469)
+ PsiElement('owns')('owns')(4446,4450)
+ PsiWhiteSpace(' ')(4450,4451)
+ PsiTypeQLElement(type) - Location: (4451,4469)(4451,4469)
+ PsiTypeQLElement(label) - Location: (4451,4469)(4451,4469)
+ PsiElement(LABEL_)('primary-motivation')(4451,4469)
+ PsiTypeQLElement(annotations_owns) - Location: (4469,4469)(4469,4469)
+
+ PsiElement(',')(',')(4469,4470)
+ PsiWhiteSpace('\n ')(4470,4475)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4475,4501)(4475,4501)
+ PsiElement('owns')('owns')(4475,4479)
+ PsiWhiteSpace(' ')(4479,4480)
+ PsiTypeQLElement(type) - Location: (4480,4501)(4480,4501)
+ PsiTypeQLElement(label) - Location: (4480,4501)(4480,4501)
+ PsiElement(LABEL_)('secondary-motivations')(4480,4501)
+ PsiTypeQLElement(annotations_owns) - Location: (4501,4501)(4501,4501)
+
+ PsiElement(',')(',')(4501,4502)
+ PsiWhiteSpace('\n\n ')(4502,4508)
+ PsiComment(COMMENT)('# Rel\n')(4508,4514)
+ PsiWhiteSpace(' ')(4514,4518)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4518,4541)(4518,4541)
+ PsiElement('plays')('plays')(4518,4523)
+ PsiWhiteSpace(' ')(4523,4524)
+ PsiTypeQLElement(type_scoped) - Location: (4524,4541)(4524,4541)
+ PsiTypeQLElement(label_scoped) - Location: (4524,4541)(4524,4541)
+ PsiElement(LABEL_SCOPED_)('targets:targeting')(4524,4541)
+ PsiElement(',')(',')(4541,4542)
+ PsiWhiteSpace('\n ')(4542,4547)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4547,4563)(4547,4563)
+ PsiElement('plays')('plays')(4547,4552)
+ PsiWhiteSpace(' ')(4552,4553)
+ PsiTypeQLElement(type_scoped) - Location: (4553,4563)(4553,4563)
+ PsiTypeQLElement(label_scoped) - Location: (4553,4563)(4553,4563)
+ PsiElement(LABEL_SCOPED_)('uses:using')(4553,4563)
+ PsiElement(',')(',')(4563,4564)
+ PsiWhiteSpace('\n ')(4564,4569)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4569,4600)(4569,4600)
+ PsiElement('plays')('plays')(4569,4574)
+ PsiWhiteSpace(' ')(4574,4575)
+ PsiTypeQLElement(type_scoped) - Location: (4575,4600)(4575,4600)
+ PsiTypeQLElement(label_scoped) - Location: (4575,4600)(4575,4600)
+ PsiElement(LABEL_SCOPED_)('attributed-to:attributing')(4575,4600)
+ PsiElement(',')(',')(4600,4601)
+ PsiWhiteSpace('\n ')(4601,4606)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4606,4636)(4606,4636)
+ PsiElement('plays')('plays')(4606,4611)
+ PsiWhiteSpace(' ')(4611,4612)
+ PsiTypeQLElement(type_scoped) - Location: (4612,4636)(4612,4636)
+ PsiTypeQLElement(label_scoped) - Location: (4612,4636)(4612,4636)
+ PsiElement(LABEL_SCOPED_)('compromises:compromising')(4612,4636)
+ PsiElement(',')(',')(4636,4637)
+ PsiWhiteSpace('\n ')(4637,4642)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4642,4675)(4642,4675)
+ PsiElement('plays')('plays')(4642,4647)
+ PsiWhiteSpace(' ')(4647,4648)
+ PsiTypeQLElement(type_scoped) - Location: (4648,4675)(4648,4675)
+ PsiTypeQLElement(label_scoped) - Location: (4648,4675)(4648,4675)
+ PsiElement(LABEL_SCOPED_)('originates-from:originating')(4648,4675)
+ PsiElement(',')(',')(4675,4676)
+ PsiWhiteSpace('\n ')(4676,4681)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4681,4700)(4681,4700)
+ PsiElement('plays')('plays')(4681,4686)
+ PsiWhiteSpace(' ')(4686,4687)
+ PsiTypeQLElement(type_scoped) - Location: (4687,4700)(4687,4700)
+ PsiTypeQLElement(label_scoped) - Location: (4687,4700)(4687,4700)
+ PsiElement(LABEL_SCOPED_)('hosts:hosting')(4687,4700)
+ PsiElement(',')(',')(4700,4701)
+ PsiWhiteSpace('\n ')(4701,4706)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4706,4729)(4706,4729)
+ PsiElement('plays')('plays')(4706,4711)
+ PsiWhiteSpace(' ')(4711,4712)
+ PsiTypeQLElement(type_scoped) - Location: (4712,4729)(4712,4729)
+ PsiTypeQLElement(label_scoped) - Location: (4712,4729)(4712,4729)
+ PsiElement(LABEL_SCOPED_)('ownerships:owning')(4712,4729)
+ PsiElement(',')(',')(4729,4730)
+ PsiWhiteSpace('\n\n ')(4730,4736)
+ PsiComment(COMMENT)('# RRel\n')(4736,4743)
+ PsiWhiteSpace(' ')(4743,4747)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4747,4772)(4747,4772)
+ PsiElement('plays')('plays')(4747,4752)
+ PsiWhiteSpace(' ')(4752,4753)
+ PsiTypeQLElement(type_scoped) - Location: (4753,4772)(4753,4772)
+ PsiTypeQLElement(label_scoped) - Location: (4753,4772)(4753,4772)
+ PsiElement(LABEL_SCOPED_)('indicates:indicated')(4753,4772)
+ PsiElement(',')(',')(4772,4773)
+ PsiWhiteSpace('\n ')(4773,4778)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4778,4808)(4778,4808)
+ PsiElement('plays')('plays')(4778,4783)
+ PsiWhiteSpace(' ')(4783,4784)
+ PsiTypeQLElement(type_scoped) - Location: (4784,4808)(4784,4808)
+ PsiTypeQLElement(label_scoped) - Location: (4784,4808)(4784,4808)
+ PsiElement(LABEL_SCOPED_)('attributed-to:attributed')(4784,4808)
+ PsiElement(',')(',')(4808,4809)
+ PsiWhiteSpace('\n ')(4809,4814)
+ PsiTypeQLPlaysType(type_constraint) - Location: (4814,4840)(4814,4840)
+ PsiElement('plays')('plays')(4814,4819)
+ PsiWhiteSpace(' ')(4819,4820)
+ PsiTypeQLElement(type_scoped) - Location: (4820,4840)(4820,4840)
+ PsiTypeQLElement(label_scoped) - Location: (4820,4840)(4820,4840)
+ PsiElement(LABEL_SCOPED_)('authored-by:authored')(4820,4840)
+ PsiElement(';')(';')(4840,4841)
+ PsiWhiteSpace('\n\n')(4841,4843)
+ PsiTypeQLElement(definable) - Location: (4843,6011)(4843,6011)
+ PsiTypeQLStatementType(statement_type) - Location: (4843,6011)(4843,6011)
+ PsiTypeQLElement(type_any) - Location: (4843,4850)(4843,4850)
+ PsiTypeQLType(type) - Name: malware - Location: (4843,4850)(4843,4850)
+ PsiTypeQLElement(label) - Location: (4843,4850)(4843,4850)
+ PsiElement(LABEL_)('malware')(4843,4850)
+ PsiWhiteSpace(' ')(4850,4851)
+ PsiTypeQLSubType(type_constraint) - Location: (4851,4873)(4851,4873)
+ PsiElement(SUB_)('sub')(4851,4854)
+ PsiWhiteSpace(' ')(4854,4855)
+ PsiTypeQLElement(type_any) - Location: (4855,4873)(4855,4873)
+ PsiTypeQLElement(type) - Location: (4855,4873)(4855,4873)
+ PsiTypeQLElement(label) - Location: (4855,4873)(4855,4873)
+ PsiElement(LABEL_)('stix-domain-object')(4855,4873)
+ PsiElement(',')(',')(4873,4874)
+ PsiWhiteSpace('\n ')(4874,4879)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4879,4888)(4879,4888)
+ PsiElement('owns')('owns')(4879,4883)
+ PsiWhiteSpace(' ')(4883,4884)
+ PsiTypeQLElement(type) - Location: (4884,4888)(4884,4888)
+ PsiTypeQLElement(label) - Location: (4884,4888)(4884,4888)
+ PsiElement(LABEL_)('name')(4884,4888)
+ PsiTypeQLElement(annotations_owns) - Location: (4888,4888)(4888,4888)
+
+ PsiElement(',')(',')(4888,4889)
+ PsiWhiteSpace('\n ')(4889,4894)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4894,4910)(4894,4910)
+ PsiElement('owns')('owns')(4894,4898)
+ PsiWhiteSpace(' ')(4898,4899)
+ PsiTypeQLElement(type) - Location: (4899,4910)(4899,4910)
+ PsiTypeQLElement(label) - Location: (4899,4910)(4899,4910)
+ PsiElement(LABEL_)('description')(4899,4910)
+ PsiTypeQLElement(annotations_owns) - Location: (4910,4910)(4910,4910)
+
+ PsiElement(',')(',')(4910,4911)
+ PsiWhiteSpace('\n ')(4911,4916)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4916,4934)(4916,4934)
+ PsiElement('owns')('owns')(4916,4920)
+ PsiWhiteSpace(' ')(4920,4921)
+ PsiTypeQLElement(type) - Location: (4921,4934)(4921,4934)
+ PsiTypeQLElement(label) - Location: (4921,4934)(4921,4934)
+ PsiElement(LABEL_)('malware-types')(4921,4934)
+ PsiTypeQLElement(annotations_owns) - Location: (4934,4934)(4934,4934)
+
+ PsiElement(',')(',')(4934,4935)
+ PsiWhiteSpace('\n ')(4935,4940)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4940,4954)(4940,4954)
+ PsiElement('owns')('owns')(4940,4944)
+ PsiWhiteSpace(' ')(4944,4945)
+ PsiTypeQLElement(type) - Location: (4945,4954)(4945,4954)
+ PsiTypeQLElement(label) - Location: (4945,4954)(4945,4954)
+ PsiElement(LABEL_)('is-family')(4945,4954)
+ PsiTypeQLElement(annotations_owns) - Location: (4954,4954)(4954,4954)
+
+ PsiElement(',')(',')(4954,4955)
+ PsiWhiteSpace('\n ')(4955,4960)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4960,4972)(4960,4972)
+ PsiElement('owns')('owns')(4960,4964)
+ PsiWhiteSpace(' ')(4964,4965)
+ PsiTypeQLElement(type) - Location: (4965,4972)(4965,4972)
+ PsiTypeQLElement(label) - Location: (4965,4972)(4965,4972)
+ PsiElement(LABEL_)('aliases')(4965,4972)
+ PsiTypeQLElement(annotations_owns) - Location: (4972,4972)(4972,4972)
+
+ PsiElement(',')(',')(4972,4973)
+ PsiWhiteSpace('\n ')(4973,4978)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4978,4993)(4978,4993)
+ PsiElement('owns')('owns')(4978,4982)
+ PsiWhiteSpace(' ')(4982,4983)
+ PsiTypeQLElement(type) - Location: (4983,4993)(4983,4993)
+ PsiTypeQLElement(label) - Location: (4983,4993)(4983,4993)
+ PsiElement(LABEL_)('first-seen')(4983,4993)
+ PsiTypeQLElement(annotations_owns) - Location: (4993,4993)(4993,4993)
+
+ PsiElement(',')(',')(4993,4994)
+ PsiWhiteSpace('\n ')(4994,4999)
+ PsiTypeQLOwnsType(type_constraint) - Location: (4999,5013)(4999,5013)
+ PsiElement('owns')('owns')(4999,5003)
+ PsiWhiteSpace(' ')(5003,5004)
+ PsiTypeQLElement(type) - Location: (5004,5013)(5004,5013)
+ PsiTypeQLElement(label) - Location: (5004,5013)(5004,5013)
+ PsiElement(LABEL_)('last-seen')(5004,5013)
+ PsiTypeQLElement(annotations_owns) - Location: (5013,5013)(5013,5013)
+
+ PsiElement(',')(',')(5013,5014)
+ PsiWhiteSpace('\n ')(5014,5019)
+ PsiTypeQLOwnsType(type_constraint) - Location: (5019,5051)(5019,5051)
+ PsiElement('owns')('owns')(5019,5023)
+ PsiWhiteSpace(' ')(5023,5024)
+ PsiTypeQLElement(type) - Location: (5024,5051)(5024,5051)
+ PsiTypeQLElement(label) - Location: (5024,5051)(5024,5051)
+ PsiElement(LABEL_)('architecture-execution-envs')(5024,5051)
+ PsiTypeQLElement(annotations_owns) - Location: (5051,5051)(5051,5051)
+
+ PsiElement(',')(',')(5051,5052)
+ PsiWhiteSpace('\n ')(5052,5057)
+ PsiTypeQLOwnsType(type_constraint) - Location: (5057,5086)(5057,5086)
+ PsiElement('owns')('owns')(5057,5061)
+ PsiWhiteSpace(' ')(5061,5062)
+ PsiTypeQLElement(type) - Location: (5062,5086)(5062,5086)
+ PsiTypeQLElement(label) - Location: (5062,5086)(5062,5086)
+ PsiElement(LABEL_)('implementation-languages')(5062,5086)
+ PsiTypeQLElement(annotations_owns) - Location: (5086,5086)(5086,5086)
+
+ PsiElement(',')(',')(5086,5087)
+ PsiWhiteSpace('\n ')(5087,5092)
+ PsiTypeQLOwnsType(type_constraint) - Location: (5092,5109)(5092,5109)
+ PsiElement('owns')('owns')(5092,5096)
+ PsiWhiteSpace(' ')(5096,5097)
+ PsiTypeQLElement(type) - Location: (5097,5109)(5097,5109)
+ PsiTypeQLElement(label) - Location: (5097,5109)(5097,5109)
+ PsiElement(LABEL_)('capabilities')(5097,5109)
+ PsiTypeQLElement(annotations_owns) - Location: (5109,5109)(5109,5109)
+
+ PsiElement(',')(',')(5109,5110)
+ PsiWhiteSpace('\n\n ')(5110,5116)
+ PsiComment(COMMENT)('# Rel\n')(5116,5122)
+ PsiWhiteSpace(' ')(5122,5126)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5126,5149)(5126,5149)
+ PsiElement('plays')('plays')(5126,5131)
+ PsiWhiteSpace(' ')(5131,5132)
+ PsiTypeQLElement(type_scoped) - Location: (5132,5149)(5132,5149)
+ PsiTypeQLElement(label_scoped) - Location: (5132,5149)(5132,5149)
+ PsiElement(LABEL_SCOPED_)('targets:targeting')(5132,5149)
+ PsiElement(',')(',')(5149,5150)
+ PsiWhiteSpace('\n ')(5150,5155)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5155,5171)(5155,5171)
+ PsiElement('plays')('plays')(5155,5160)
+ PsiWhiteSpace(' ')(5160,5161)
+ PsiTypeQLElement(type_scoped) - Location: (5161,5171)(5161,5171)
+ PsiTypeQLElement(label_scoped) - Location: (5161,5171)(5161,5171)
+ PsiElement(LABEL_SCOPED_)('uses:using')(5161,5171)
+ PsiElement(',')(',')(5171,5172)
+ PsiWhiteSpace('\n ')(5172,5177)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5177,5210)(5177,5210)
+ PsiElement('plays')('plays')(5177,5182)
+ PsiWhiteSpace(' ')(5182,5183)
+ PsiTypeQLElement(type_scoped) - Location: (5183,5210)(5183,5210)
+ PsiTypeQLElement(label_scoped) - Location: (5183,5210)(5183,5210)
+ PsiElement(LABEL_SCOPED_)('originates-from:originating')(5183,5210)
+ PsiElement(',')(',')(5210,5211)
+ PsiWhiteSpace('\n ')(5211,5216)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5216,5242)(5216,5242)
+ PsiElement('plays')('plays')(5216,5221)
+ PsiWhiteSpace(' ')(5221,5222)
+ PsiTypeQLElement(type_scoped) - Location: (5222,5242)(5222,5242)
+ PsiTypeQLElement(label_scoped) - Location: (5222,5242)(5222,5242)
+ PsiElement(LABEL_SCOPED_)('controls:controlling')(5222,5242)
+ PsiElement(',')(',')(5242,5243)
+ PsiWhiteSpace('\n ')(5243,5248)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5248,5267)(5248,5267)
+ PsiElement('plays')('plays')(5248,5253)
+ PsiWhiteSpace(' ')(5253,5254)
+ PsiTypeQLElement(type_scoped) - Location: (5254,5267)(5254,5267)
+ PsiTypeQLElement(label_scoped) - Location: (5254,5267)(5254,5267)
+ PsiElement(LABEL_SCOPED_)('hosts:hosting')(5254,5267)
+ PsiElement(',')(',')(5267,5268)
+ PsiWhiteSpace('\n ')(5268,5273)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5273,5300)(5273,5300)
+ PsiElement('plays')('plays')(5273,5278)
+ PsiWhiteSpace(' ')(5278,5279)
+ PsiTypeQLElement(type_scoped) - Location: (5279,5300)(5279,5300)
+ PsiTypeQLElement(label_scoped) - Location: (5279,5300)(5279,5300)
+ PsiElement(LABEL_SCOPED_)('authored-by:authoring')(5279,5300)
+ PsiElement(',')(',')(5300,5301)
+ PsiWhiteSpace('\n ')(5301,5306)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5306,5335)(5306,5335)
+ PsiElement('plays')('plays')(5306,5311)
+ PsiWhiteSpace(' ')(5311,5312)
+ PsiTypeQLElement(type_scoped) - Location: (5312,5335)(5312,5335)
+ PsiTypeQLElement(label_scoped) - Location: (5312,5335)(5312,5335)
+ PsiElement(LABEL_SCOPED_)('beacons-to:beaconing-to')(5312,5335)
+ PsiElement(',')(',')(5335,5336)
+ PsiWhiteSpace('\n ')(5336,5341)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5341,5377)(5341,5377)
+ PsiElement('plays')('plays')(5341,5346)
+ PsiWhiteSpace(' ')(5346,5347)
+ PsiTypeQLElement(type_scoped) - Location: (5347,5377)(5347,5377)
+ PsiTypeQLElement(label_scoped) - Location: (5347,5377)(5347,5377)
+ PsiElement(LABEL_SCOPED_)('exfiltrates-to:exfiltrating-to')(5347,5377)
+ PsiElement(',')(',')(5377,5378)
+ PsiWhiteSpace('\n ')(5378,5383)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5383,5410)(5383,5410)
+ PsiElement('plays')('plays')(5383,5388)
+ PsiWhiteSpace(' ')(5388,5389)
+ PsiTypeQLElement(type_scoped) - Location: (5389,5410)(5389,5410)
+ PsiTypeQLElement(label_scoped) - Location: (5389,5410)(5389,5410)
+ PsiElement(LABEL_SCOPED_)('downloads:downloading')(5389,5410)
+ PsiElement(',')(',')(5410,5411)
+ PsiWhiteSpace('\n ')(5411,5416)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5416,5436)(5416,5436)
+ PsiElement('plays')('plays')(5416,5421)
+ PsiWhiteSpace(' ')(5421,5422)
+ PsiTypeQLElement(type_scoped) - Location: (5422,5436)(5422,5436)
+ PsiTypeQLElement(label_scoped) - Location: (5422,5436)(5422,5436)
+ PsiElement(LABEL_SCOPED_)('drops:dropping')(5422,5436)
+ PsiElement(',')(',')(5436,5437)
+ PsiWhiteSpace('\n ')(5437,5442)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5442,5467)(5442,5467)
+ PsiElement('plays')('plays')(5442,5447)
+ PsiWhiteSpace(' ')(5447,5448)
+ PsiTypeQLElement(type_scoped) - Location: (5448,5467)(5448,5467)
+ PsiTypeQLElement(label_scoped) - Location: (5448,5467)(5448,5467)
+ PsiElement(LABEL_SCOPED_)('exploits:exploiting')(5448,5467)
+ PsiElement(',')(',')(5467,5468)
+ PsiWhiteSpace('\n ')(5468,5473)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5473,5504)(5473,5504)
+ PsiElement('plays')('plays')(5473,5478)
+ PsiWhiteSpace(' ')(5478,5479)
+ PsiTypeQLElement(type_scoped) - Location: (5479,5504)(5479,5504)
+ PsiTypeQLElement(label_scoped) - Location: (5479,5504)(5479,5504)
+ PsiElement(LABEL_SCOPED_)('variant-of:varianted-from')(5479,5504)
+ PsiElement(',')(',')(5504,5505)
+ PsiWhiteSpace('\n ')(5505,5510)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5510,5547)(5510,5547)
+ PsiElement('plays')('plays')(5510,5515)
+ PsiWhiteSpace(' ')(5515,5516)
+ PsiTypeQLElement(type_scoped) - Location: (5516,5547)(5516,5547)
+ PsiTypeQLElement(label_scoped) - Location: (5516,5547)(5516,5547)
+ PsiElement(LABEL_SCOPED_)('communicates-with:communicating')(5516,5547)
+ PsiElement(',')(',')(5547,5548)
+ PsiWhiteSpace('\n\n ')(5548,5554)
+ PsiComment(COMMENT)('# RRel\n')(5554,5561)
+ PsiWhiteSpace(' ')(5561,5565)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5565,5595)(5565,5595)
+ PsiElement('plays')('plays')(5565,5570)
+ PsiWhiteSpace(' ')(5570,5571)
+ PsiTypeQLElement(type_scoped) - Location: (5571,5595)(5571,5595)
+ PsiTypeQLElement(label_scoped) - Location: (5571,5595)(5571,5595)
+ PsiElement(LABEL_SCOPED_)('attributed-to:attributed')(5571,5595)
+ PsiElement(',')(',')(5595,5596)
+ PsiWhiteSpace('\n ')(5596,5601)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5601,5626)(5601,5626)
+ PsiElement('plays')('plays')(5601,5606)
+ PsiWhiteSpace(' ')(5606,5607)
+ PsiTypeQLElement(type_scoped) - Location: (5607,5626)(5607,5626)
+ PsiTypeQLElement(label_scoped) - Location: (5607,5626)(5607,5626)
+ PsiElement(LABEL_SCOPED_)('controls:controlled')(5607,5626)
+ PsiElement(',')(',')(5626,5627)
+ PsiWhiteSpace('\n ')(5627,5632)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5632,5659)(5632,5659)
+ PsiElement('plays')('plays')(5632,5637)
+ PsiWhiteSpace(' ')(5637,5638)
+ PsiTypeQLElement(type_scoped) - Location: (5638,5659)(5638,5659)
+ PsiTypeQLElement(label_scoped) - Location: (5638,5659)(5638,5659)
+ PsiElement(LABEL_SCOPED_)('remediates:remediated')(5638,5659)
+ PsiElement(',')(',')(5659,5660)
+ PsiWhiteSpace('\n ')(5660,5665)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5665,5690)(5665,5690)
+ PsiElement('plays')('plays')(5665,5670)
+ PsiWhiteSpace(' ')(5670,5671)
+ PsiTypeQLElement(type_scoped) - Location: (5671,5690)(5671,5690)
+ PsiTypeQLElement(label_scoped) - Location: (5671,5690)(5671,5690)
+ PsiElement(LABEL_SCOPED_)('mitigates:mitigated')(5671,5690)
+ PsiElement(',')(',')(5690,5691)
+ PsiWhiteSpace('\n ')(5691,5696)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5696,5711)(5696,5711)
+ PsiElement('plays')('plays')(5696,5701)
+ PsiWhiteSpace(' ')(5701,5702)
+ PsiTypeQLElement(type_scoped) - Location: (5702,5711)(5702,5711)
+ PsiTypeQLElement(label_scoped) - Location: (5702,5711)(5702,5711)
+ PsiElement(LABEL_SCOPED_)('uses:used')(5702,5711)
+ PsiElement(',')(',')(5711,5712)
+ PsiWhiteSpace('\n ')(5712,5717)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5717,5741)(5717,5741)
+ PsiElement('plays')('plays')(5717,5722)
+ PsiWhiteSpace(' ')(5722,5723)
+ PsiTypeQLElement(type_scoped) - Location: (5723,5741)(5723,5741)
+ PsiTypeQLElement(label_scoped) - Location: (5723,5741)(5723,5741)
+ PsiElement(LABEL_SCOPED_)('delivers:delivered')(5723,5741)
+ PsiElement(',')(',')(5741,5742)
+ PsiWhiteSpace('\n ')(5742,5747)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5747,5772)(5747,5772)
+ PsiElement('plays')('plays')(5747,5752)
+ PsiWhiteSpace(' ')(5752,5753)
+ PsiTypeQLElement(type_scoped) - Location: (5753,5772)(5753,5772)
+ PsiTypeQLElement(label_scoped) - Location: (5753,5772)(5753,5772)
+ PsiElement(LABEL_SCOPED_)('indicates:indicated')(5753,5772)
+ PsiElement(',')(',')(5772,5773)
+ PsiWhiteSpace('\n ')(5773,5778)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5778,5804)(5778,5804)
+ PsiElement('plays')('plays')(5778,5783)
+ PsiWhiteSpace(' ')(5783,5784)
+ PsiTypeQLElement(type_scoped) - Location: (5784,5804)(5784,5804)
+ PsiTypeQLElement(label_scoped) - Location: (5784,5804)(5784,5804)
+ PsiElement(LABEL_SCOPED_)('downloads:downloaded')(5784,5804)
+ PsiElement(',')(',')(5804,5805)
+ PsiWhiteSpace('\n ')(5805,5810)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5810,5829)(5810,5829)
+ PsiElement('plays')('plays')(5810,5815)
+ PsiWhiteSpace(' ')(5815,5816)
+ PsiTypeQLElement(type_scoped) - Location: (5816,5829)(5816,5829)
+ PsiTypeQLElement(label_scoped) - Location: (5816,5829)(5816,5829)
+ PsiElement(LABEL_SCOPED_)('drops:dropped')(5816,5829)
+ PsiElement(',')(',')(5829,5830)
+ PsiWhiteSpace('\n ')(5830,5835)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5835,5861)(5835,5861)
+ PsiElement('plays')('plays')(5835,5840)
+ PsiWhiteSpace(' ')(5840,5841)
+ PsiTypeQLElement(type_scoped) - Location: (5841,5861)(5841,5861)
+ PsiTypeQLElement(label_scoped) - Location: (5841,5861)(5841,5861)
+ PsiElement(LABEL_SCOPED_)('variant-of:varianted')(5841,5861)
+ PsiElement(',')(',')(5861,5862)
+ PsiWhiteSpace('\n ')(5862,5867)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5867,5900)(5867,5900)
+ PsiElement('plays')('plays')(5867,5872)
+ PsiWhiteSpace(' ')(5872,5873)
+ PsiTypeQLElement(type_scoped) - Location: (5873,5900)(5873,5900)
+ PsiTypeQLElement(label_scoped) - Location: (5873,5900)(5873,5900)
+ PsiElement(LABEL_SCOPED_)('characterizes:characterized')(5873,5900)
+ PsiElement(',')(',')(5900,5901)
+ PsiWhiteSpace('\n ')(5901,5906)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5906,5932)(5906,5932)
+ PsiElement('plays')('plays')(5906,5911)
+ PsiWhiteSpace(' ')(5911,5912)
+ PsiTypeQLElement(type_scoped) - Location: (5912,5932)(5912,5932)
+ PsiTypeQLElement(label_scoped) - Location: (5912,5932)(5912,5932)
+ PsiElement(LABEL_SCOPED_)('analysis-of:analysed')(5912,5932)
+ PsiElement(',')(',')(5932,5933)
+ PsiWhiteSpace('\n ')(5933,5938)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5938,5971)(5938,5971)
+ PsiElement('plays')('plays')(5938,5943)
+ PsiWhiteSpace(' ')(5943,5944)
+ PsiTypeQLElement(type_scoped) - Location: (5944,5971)(5944,5971)
+ PsiTypeQLElement(label_scoped) - Location: (5944,5971)(5944,5971)
+ PsiElement(LABEL_SCOPED_)('static-analysis-of:analysed')(5944,5971)
+ PsiElement(',')(',')(5971,5972)
+ PsiWhiteSpace('\n ')(5972,5977)
+ PsiTypeQLPlaysType(type_constraint) - Location: (5977,6011)(5977,6011)
+ PsiElement('plays')('plays')(5977,5982)
+ PsiWhiteSpace(' ')(5982,5983)
+ PsiTypeQLElement(type_scoped) - Location: (5983,6011)(5983,6011)
+ PsiTypeQLElement(label_scoped) - Location: (5983,6011)(5983,6011)
+ PsiElement(LABEL_SCOPED_)('dynamic-analysis-of:analysed')(5983,6011)
+ PsiElement(';')(';')(6011,6012)
+ PsiWhiteSpace('\n\n')(6012,6014)
+ PsiTypeQLElement(definable) - Location: (6014,6376)(6014,6376)
+ PsiTypeQLStatementType(statement_type) - Location: (6014,6376)(6014,6376)
+ PsiTypeQLElement(type_any) - Location: (6014,6022)(6014,6022)
+ PsiTypeQLType(type) - Name: location - Location: (6014,6022)(6014,6022)
+ PsiTypeQLElement(label) - Location: (6014,6022)(6014,6022)
+ PsiElement(LABEL_)('location')(6014,6022)
+ PsiWhiteSpace(' ')(6022,6023)
+ PsiTypeQLSubType(type_constraint) - Location: (6023,6045)(6023,6045)
+ PsiElement(SUB_)('sub')(6023,6026)
+ PsiWhiteSpace(' ')(6026,6027)
+ PsiTypeQLElement(type_any) - Location: (6027,6045)(6027,6045)
+ PsiTypeQLElement(type) - Location: (6027,6045)(6027,6045)
+ PsiTypeQLElement(label) - Location: (6027,6045)(6027,6045)
+ PsiElement(LABEL_)('stix-domain-object')(6027,6045)
+ PsiElement(',')(',')(6045,6046)
+ PsiWhiteSpace('\n ')(6046,6051)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6051,6060)(6051,6060)
+ PsiElement('owns')('owns')(6051,6055)
+ PsiWhiteSpace(' ')(6055,6056)
+ PsiTypeQLElement(type) - Location: (6056,6060)(6056,6060)
+ PsiTypeQLElement(label) - Location: (6056,6060)(6056,6060)
+ PsiElement(LABEL_)('name')(6056,6060)
+ PsiTypeQLElement(annotations_owns) - Location: (6060,6060)(6060,6060)
+
+ PsiElement(',')(',')(6060,6061)
+ PsiWhiteSpace('\n ')(6061,6066)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6066,6082)(6066,6082)
+ PsiElement('owns')('owns')(6066,6070)
+ PsiWhiteSpace(' ')(6070,6071)
+ PsiTypeQLElement(type) - Location: (6071,6082)(6071,6082)
+ PsiTypeQLElement(label) - Location: (6071,6082)(6071,6082)
+ PsiElement(LABEL_)('description')(6071,6082)
+ PsiTypeQLElement(annotations_owns) - Location: (6082,6082)(6082,6082)
+
+ PsiElement(',')(',')(6082,6083)
+ PsiWhiteSpace('\n ')(6083,6088)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6088,6101)(6088,6101)
+ PsiElement('owns')('owns')(6088,6092)
+ PsiWhiteSpace(' ')(6092,6093)
+ PsiTypeQLElement(type) - Location: (6093,6101)(6093,6101)
+ PsiTypeQLElement(label) - Location: (6093,6101)(6093,6101)
+ PsiElement(LABEL_)('latitude')(6093,6101)
+ PsiTypeQLElement(annotations_owns) - Location: (6101,6101)(6101,6101)
+
+ PsiElement(',')(',')(6101,6102)
+ PsiWhiteSpace('\n ')(6102,6107)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6107,6121)(6107,6121)
+ PsiElement('owns')('owns')(6107,6111)
+ PsiWhiteSpace(' ')(6111,6112)
+ PsiTypeQLElement(type) - Location: (6112,6121)(6112,6121)
+ PsiTypeQLElement(label) - Location: (6112,6121)(6112,6121)
+ PsiElement(LABEL_)('longitude')(6112,6121)
+ PsiTypeQLElement(annotations_owns) - Location: (6121,6121)(6121,6121)
+
+ PsiElement(',')(',')(6121,6122)
+ PsiWhiteSpace('\n ')(6122,6127)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6127,6141)(6127,6141)
+ PsiElement('owns')('owns')(6127,6131)
+ PsiWhiteSpace(' ')(6131,6132)
+ PsiTypeQLElement(type) - Location: (6132,6141)(6132,6141)
+ PsiTypeQLElement(label) - Location: (6132,6141)(6132,6141)
+ PsiElement(LABEL_)('precision')(6132,6141)
+ PsiTypeQLElement(annotations_owns) - Location: (6141,6141)(6141,6141)
+
+ PsiElement(',')(',')(6141,6142)
+ PsiWhiteSpace('\n ')(6142,6147)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6147,6158)(6147,6158)
+ PsiElement('owns')('owns')(6147,6151)
+ PsiWhiteSpace(' ')(6151,6152)
+ PsiTypeQLElement(type) - Location: (6152,6158)(6152,6158)
+ PsiTypeQLElement(label) - Location: (6152,6158)(6152,6158)
+ PsiElement(LABEL_)('region')(6152,6158)
+ PsiTypeQLElement(annotations_owns) - Location: (6158,6158)(6158,6158)
+
+ PsiElement(',')(',')(6158,6159)
+ PsiWhiteSpace('\n ')(6159,6164)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6164,6176)(6164,6176)
+ PsiElement('owns')('owns')(6164,6168)
+ PsiWhiteSpace(' ')(6168,6169)
+ PsiTypeQLElement(type) - Location: (6169,6176)(6169,6176)
+ PsiTypeQLElement(label) - Location: (6169,6176)(6169,6176)
+ PsiElement(LABEL_)('country')(6169,6176)
+ PsiTypeQLElement(annotations_owns) - Location: (6176,6176)(6176,6176)
+
+ PsiElement(',')(',')(6176,6177)
+ PsiWhiteSpace('\n ')(6177,6182)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6182,6206)(6182,6206)
+ PsiElement('owns')('owns')(6182,6186)
+ PsiWhiteSpace(' ')(6186,6187)
+ PsiTypeQLElement(type) - Location: (6187,6206)(6187,6206)
+ PsiTypeQLElement(label) - Location: (6187,6206)(6187,6206)
+ PsiElement(LABEL_)('administrative-area')(6187,6206)
+ PsiTypeQLElement(annotations_owns) - Location: (6206,6206)(6206,6206)
+
+ PsiElement(',')(',')(6206,6207)
+ PsiWhiteSpace('\n ')(6207,6212)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6212,6221)(6212,6221)
+ PsiElement('owns')('owns')(6212,6216)
+ PsiWhiteSpace(' ')(6216,6217)
+ PsiTypeQLElement(type) - Location: (6217,6221)(6217,6221)
+ PsiTypeQLElement(label) - Location: (6217,6221)(6217,6221)
+ PsiElement(LABEL_)('city')(6217,6221)
+ PsiTypeQLElement(annotations_owns) - Location: (6221,6221)(6221,6221)
+
+ PsiElement(',')(',')(6221,6222)
+ PsiWhiteSpace('\n ')(6222,6227)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6227,6246)(6227,6246)
+ PsiElement('owns')('owns')(6227,6231)
+ PsiWhiteSpace(' ')(6231,6232)
+ PsiTypeQLElement(type) - Location: (6232,6246)(6232,6246)
+ PsiTypeQLElement(label) - Location: (6232,6246)(6232,6246)
+ PsiElement(LABEL_)('street-address')(6232,6246)
+ PsiTypeQLElement(annotations_owns) - Location: (6246,6246)(6246,6246)
+
+ PsiElement(',')(',')(6246,6247)
+ PsiWhiteSpace('\n ')(6247,6252)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6252,6268)(6252,6268)
+ PsiElement('owns')('owns')(6252,6256)
+ PsiWhiteSpace(' ')(6256,6257)
+ PsiTypeQLElement(type) - Location: (6257,6268)(6257,6268)
+ PsiTypeQLElement(label) - Location: (6257,6268)(6257,6268)
+ PsiElement(LABEL_)('postal-code')(6257,6268)
+ PsiTypeQLElement(annotations_owns) - Location: (6268,6268)(6268,6268)
+
+ PsiElement(',')(',')(6268,6269)
+ PsiWhiteSpace('\n\n ')(6269,6275)
+ PsiComment(COMMENT)('# RRel\n')(6275,6282)
+ PsiWhiteSpace(' ')(6282,6286)
+ PsiTypeQLPlaysType(type_constraint) - Location: (6286,6308)(6286,6308)
+ PsiElement('plays')('plays')(6286,6291)
+ PsiWhiteSpace(' ')(6291,6292)
+ PsiTypeQLElement(type_scoped) - Location: (6292,6308)(6292,6308)
+ PsiTypeQLElement(label_scoped) - Location: (6292,6308)(6292,6308)
+ PsiElement(LABEL_SCOPED_)('targets:targeted')(6292,6308)
+ PsiElement(',')(',')(6308,6309)
+ PsiWhiteSpace('\n ')(6309,6314)
+ PsiTypeQLPlaysType(type_constraint) - Location: (6314,6346)(6314,6346)
+ PsiElement('plays')('plays')(6314,6319)
+ PsiWhiteSpace(' ')(6319,6320)
+ PsiTypeQLElement(type_scoped) - Location: (6320,6346)(6320,6346)
+ PsiTypeQLElement(label_scoped) - Location: (6320,6346)(6320,6346)
+ PsiElement(LABEL_SCOPED_)('originates-from:originated')(6320,6346)
+ PsiElement(',')(',')(6346,6347)
+ PsiWhiteSpace('\n ')(6347,6352)
+ PsiTypeQLPlaysType(type_constraint) - Location: (6352,6376)(6352,6376)
+ PsiElement('plays')('plays')(6352,6357)
+ PsiWhiteSpace(' ')(6357,6358)
+ PsiTypeQLElement(type_scoped) - Location: (6358,6376)(6358,6376)
+ PsiTypeQLElement(label_scoped) - Location: (6358,6376)(6358,6376)
+ PsiElement(LABEL_SCOPED_)('located-at:located')(6358,6376)
+ PsiElement(';')(';')(6376,6377)
+ PsiWhiteSpace('\n\n')(6377,6379)
+ PsiTypeQLElement(definable) - Location: (6379,6851)(6379,6851)
+ PsiTypeQLStatementType(statement_type) - Location: (6379,6851)(6379,6851)
+ PsiTypeQLElement(type_any) - Location: (6379,6395)(6379,6395)
+ PsiTypeQLType(type) - Name: malware-analysis - Location: (6379,6395)(6379,6395)
+ PsiTypeQLElement(label) - Location: (6379,6395)(6379,6395)
+ PsiElement(LABEL_)('malware-analysis')(6379,6395)
+ PsiWhiteSpace(' ')(6395,6396)
+ PsiTypeQLSubType(type_constraint) - Location: (6396,6418)(6396,6418)
+ PsiElement(SUB_)('sub')(6396,6399)
+ PsiWhiteSpace(' ')(6399,6400)
+ PsiTypeQLElement(type_any) - Location: (6400,6418)(6400,6418)
+ PsiTypeQLElement(type) - Location: (6400,6418)(6400,6418)
+ PsiTypeQLElement(label) - Location: (6400,6418)(6400,6418)
+ PsiElement(LABEL_)('stix-domain-object')(6400,6418)
+ PsiElement(',')(',')(6418,6419)
+ PsiWhiteSpace('\n ')(6419,6424)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6424,6436)(6424,6436)
+ PsiElement('owns')('owns')(6424,6428)
+ PsiWhiteSpace(' ')(6428,6429)
+ PsiTypeQLElement(type) - Location: (6429,6436)(6429,6436)
+ PsiTypeQLElement(label) - Location: (6429,6436)(6429,6436)
+ PsiElement(LABEL_)('product')(6429,6436)
+ PsiTypeQLElement(annotations_owns) - Location: (6436,6436)(6436,6436)
+
+ PsiElement(',')(',')(6436,6437)
+ PsiWhiteSpace('\n ')(6437,6442)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6442,6454)(6442,6454)
+ PsiElement('owns')('owns')(6442,6446)
+ PsiWhiteSpace(' ')(6446,6447)
+ PsiTypeQLElement(type) - Location: (6447,6454)(6447,6454)
+ PsiTypeQLElement(label) - Location: (6447,6454)(6447,6454)
+ PsiElement(LABEL_)('version')(6447,6454)
+ PsiTypeQLElement(annotations_owns) - Location: (6454,6454)(6454,6454)
+
+ PsiElement(',')(',')(6454,6455)
+ PsiWhiteSpace('\n ')(6455,6460)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6460,6486)(6460,6486)
+ PsiElement('owns')('owns')(6460,6464)
+ PsiWhiteSpace(' ')(6464,6465)
+ PsiTypeQLElement(type) - Location: (6465,6486)(6465,6486)
+ PsiTypeQLElement(label) - Location: (6465,6486)(6465,6486)
+ PsiElement(LABEL_)('configuration-version')(6465,6486)
+ PsiTypeQLElement(annotations_owns) - Location: (6486,6486)(6486,6486)
+
+ PsiElement(',')(',')(6486,6487)
+ PsiWhiteSpace('\n ')(6487,6492)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6492,6503)(6492,6503)
+ PsiElement('owns')('owns')(6492,6496)
+ PsiWhiteSpace(' ')(6496,6497)
+ PsiTypeQLElement(type) - Location: (6497,6503)(6497,6503)
+ PsiTypeQLElement(label) - Location: (6497,6503)(6497,6503)
+ PsiElement(LABEL_)('module')(6497,6503)
+ PsiTypeQLElement(annotations_owns) - Location: (6503,6503)(6503,6503)
+
+ PsiElement(',')(',')(6503,6504)
+ PsiWhiteSpace('\n ')(6504,6509)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6509,6537)(6509,6537)
+ PsiElement('owns')('owns')(6509,6513)
+ PsiWhiteSpace(' ')(6513,6514)
+ PsiTypeQLElement(type) - Location: (6514,6537)(6514,6537)
+ PsiTypeQLElement(label) - Location: (6514,6537)(6514,6537)
+ PsiElement(LABEL_)('analysis-engine-version')(6514,6537)
+ PsiTypeQLElement(annotations_owns) - Location: (6537,6537)(6537,6537)
+
+ PsiElement(',')(',')(6537,6538)
+ PsiWhiteSpace('\n ')(6538,6543)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6543,6575)(6543,6575)
+ PsiElement('owns')('owns')(6543,6547)
+ PsiWhiteSpace(' ')(6547,6548)
+ PsiTypeQLElement(type) - Location: (6548,6575)(6548,6575)
+ PsiTypeQLElement(label) - Location: (6548,6575)(6548,6575)
+ PsiElement(LABEL_)('analysis-definition-version')(6548,6575)
+ PsiTypeQLElement(annotations_owns) - Location: (6575,6575)(6575,6575)
+
+ PsiElement(',')(',')(6575,6576)
+ PsiWhiteSpace('\n ')(6576,6581)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6581,6595)(6581,6595)
+ PsiElement('owns')('owns')(6581,6585)
+ PsiWhiteSpace(' ')(6585,6586)
+ PsiTypeQLElement(type) - Location: (6586,6595)(6586,6595)
+ PsiTypeQLElement(label) - Location: (6586,6595)(6586,6595)
+ PsiElement(LABEL_)('submitted')(6586,6595)
+ PsiTypeQLElement(annotations_owns) - Location: (6595,6595)(6595,6595)
+
+ PsiElement(',')(',')(6595,6596)
+ PsiWhiteSpace('\n ')(6596,6601)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6601,6622)(6601,6622)
+ PsiElement('owns')('owns')(6601,6605)
+ PsiWhiteSpace(' ')(6605,6606)
+ PsiTypeQLElement(type) - Location: (6606,6622)(6606,6622)
+ PsiTypeQLElement(label) - Location: (6606,6622)(6606,6622)
+ PsiElement(LABEL_)('analysis-started')(6606,6622)
+ PsiTypeQLElement(annotations_owns) - Location: (6622,6622)(6622,6622)
+
+ PsiElement(',')(',')(6622,6623)
+ PsiWhiteSpace('\n ')(6623,6628)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6628,6647)(6628,6647)
+ PsiElement('owns')('owns')(6628,6632)
+ PsiWhiteSpace(' ')(6632,6633)
+ PsiTypeQLElement(type) - Location: (6633,6647)(6633,6647)
+ PsiTypeQLElement(label) - Location: (6633,6647)(6633,6647)
+ PsiElement(LABEL_)('analysis-ended')(6633,6647)
+ PsiTypeQLElement(annotations_owns) - Location: (6647,6647)(6647,6647)
+
+ PsiElement(',')(',')(6647,6648)
+ PsiWhiteSpace('\n ')(6648,6653)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6653,6669)(6653,6669)
+ PsiElement('owns')('owns')(6653,6657)
+ PsiWhiteSpace(' ')(6657,6658)
+ PsiTypeQLElement(type) - Location: (6658,6669)(6658,6669)
+ PsiTypeQLElement(label) - Location: (6658,6669)(6658,6669)
+ PsiElement(LABEL_)('result-name')(6658,6669)
+ PsiTypeQLElement(annotations_owns) - Location: (6669,6669)(6669,6669)
+
+ PsiElement(',')(',')(6669,6670)
+ PsiWhiteSpace('\n ')(6670,6675)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6675,6686)(6675,6686)
+ PsiElement('owns')('owns')(6675,6679)
+ PsiWhiteSpace(' ')(6679,6680)
+ PsiTypeQLElement(type) - Location: (6680,6686)(6680,6686)
+ PsiTypeQLElement(label) - Location: (6680,6686)(6680,6686)
+ PsiElement(LABEL_)('result')(6680,6686)
+ PsiTypeQLElement(annotations_owns) - Location: (6686,6686)(6686,6686)
+
+ PsiElement(',')(',')(6686,6687)
+ PsiWhiteSpace('\n\n ')(6687,6693)
+ PsiComment(COMMENT)('# Rel\n')(6693,6699)
+ PsiWhiteSpace(' ')(6699,6703)
+ PsiTypeQLPlaysType(type_constraint) - Location: (6703,6737)(6703,6737)
+ PsiElement('plays')('plays')(6703,6708)
+ PsiWhiteSpace(' ')(6708,6709)
+ PsiTypeQLElement(type_scoped) - Location: (6709,6737)(6709,6737)
+ PsiTypeQLElement(label_scoped) - Location: (6709,6737)(6709,6737)
+ PsiElement(LABEL_SCOPED_)('characterizes:characterizing')(6709,6737)
+ PsiElement(',')(',')(6737,6738)
+ PsiWhiteSpace('\n ')(6738,6743)
+ PsiTypeQLPlaysType(type_constraint) - Location: (6743,6770)(6743,6770)
+ PsiElement('plays')('plays')(6743,6748)
+ PsiWhiteSpace(' ')(6748,6749)
+ PsiTypeQLElement(type_scoped) - Location: (6749,6770)(6749,6770)
+ PsiTypeQLElement(label_scoped) - Location: (6749,6770)(6749,6770)
+ PsiElement(LABEL_SCOPED_)('analysis-of:analysing')(6749,6770)
+ PsiElement(',')(',')(6770,6771)
+ PsiWhiteSpace('\n ')(6771,6776)
+ PsiTypeQLPlaysType(type_constraint) - Location: (6776,6810)(6776,6810)
+ PsiElement('plays')('plays')(6776,6781)
+ PsiWhiteSpace(' ')(6781,6782)
+ PsiTypeQLElement(type_scoped) - Location: (6782,6810)(6782,6810)
+ PsiTypeQLElement(label_scoped) - Location: (6782,6810)(6782,6810)
+ PsiElement(LABEL_SCOPED_)('static-analysis-of:analysing')(6782,6810)
+ PsiElement(',')(',')(6810,6811)
+ PsiWhiteSpace('\n ')(6811,6816)
+ PsiTypeQLPlaysType(type_constraint) - Location: (6816,6851)(6816,6851)
+ PsiElement('plays')('plays')(6816,6821)
+ PsiWhiteSpace(' ')(6821,6822)
+ PsiTypeQLElement(type_scoped) - Location: (6822,6851)(6822,6851)
+ PsiTypeQLElement(label_scoped) - Location: (6822,6851)(6822,6851)
+ PsiElement(LABEL_SCOPED_)('dynamic-analysis-of:analysing')(6822,6851)
+ PsiElement(';')(';')(6851,6852)
+ PsiWhiteSpace('\n\n')(6852,6854)
+ PsiTypeQLElement(definable) - Location: (6854,6941)(6854,6941)
+ PsiTypeQLStatementType(statement_type) - Location: (6854,6941)(6854,6941)
+ PsiTypeQLElement(type_any) - Location: (6854,6858)(6854,6858)
+ PsiTypeQLType(type) - Name: note - Location: (6854,6858)(6854,6858)
+ PsiTypeQLElement(label) - Location: (6854,6858)(6854,6858)
+ PsiElement(LABEL_)('note')(6854,6858)
+ PsiWhiteSpace(' ')(6858,6859)
+ PsiTypeQLSubType(type_constraint) - Location: (6859,6881)(6859,6881)
+ PsiElement(SUB_)('sub')(6859,6862)
+ PsiWhiteSpace(' ')(6862,6863)
+ PsiTypeQLElement(type_any) - Location: (6863,6881)(6863,6881)
+ PsiTypeQLElement(type) - Location: (6863,6881)(6863,6881)
+ PsiTypeQLElement(label) - Location: (6863,6881)(6863,6881)
+ PsiElement(LABEL_)('stix-domain-object')(6863,6881)
+ PsiElement(',')(',')(6881,6882)
+ PsiWhiteSpace('\n ')(6882,6887)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6887,6905)(6887,6905)
+ PsiElement('owns')('owns')(6887,6891)
+ PsiWhiteSpace(' ')(6891,6892)
+ PsiTypeQLElement(type) - Location: (6892,6905)(6892,6905)
+ PsiTypeQLElement(label) - Location: (6892,6905)(6892,6905)
+ PsiElement(LABEL_)('note-abstract')(6892,6905)
+ PsiTypeQLElement(annotations_owns) - Location: (6905,6905)(6905,6905)
+
+ PsiElement(',')(',')(6905,6906)
+ PsiWhiteSpace('\n ')(6906,6911)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6911,6923)(6911,6923)
+ PsiElement('owns')('owns')(6911,6915)
+ PsiWhiteSpace(' ')(6915,6916)
+ PsiTypeQLElement(type) - Location: (6916,6923)(6916,6923)
+ PsiTypeQLElement(label) - Location: (6916,6923)(6916,6923)
+ PsiElement(LABEL_)('content')(6916,6923)
+ PsiTypeQLElement(annotations_owns) - Location: (6923,6923)(6923,6923)
+
+ PsiElement(',')(',')(6923,6924)
+ PsiWhiteSpace('\n ')(6924,6929)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6929,6941)(6929,6941)
+ PsiElement('owns')('owns')(6929,6933)
+ PsiWhiteSpace(' ')(6933,6934)
+ PsiTypeQLElement(type) - Location: (6934,6941)(6934,6941)
+ PsiTypeQLElement(label) - Location: (6934,6941)(6934,6941)
+ PsiElement(LABEL_)('authors')(6934,6941)
+ PsiTypeQLElement(annotations_owns) - Location: (6941,6941)(6941,6941)
+
+ PsiElement(';')(';')(6941,6942)
+ PsiWhiteSpace('\n\n')(6942,6944)
+ PsiTypeQLElement(definable) - Location: (6944,7037)(6944,7037)
+ PsiTypeQLStatementType(statement_type) - Location: (6944,7037)(6944,7037)
+ PsiTypeQLElement(type_any) - Location: (6944,6951)(6944,6951)
+ PsiTypeQLType(type) - Name: opinion - Location: (6944,6951)(6944,6951)
+ PsiTypeQLElement(label) - Location: (6944,6951)(6944,6951)
+ PsiElement(LABEL_)('opinion')(6944,6951)
+ PsiWhiteSpace(' ')(6951,6952)
+ PsiTypeQLSubType(type_constraint) - Location: (6952,6974)(6952,6974)
+ PsiElement(SUB_)('sub')(6952,6955)
+ PsiWhiteSpace(' ')(6955,6956)
+ PsiTypeQLElement(type_any) - Location: (6956,6974)(6956,6974)
+ PsiTypeQLElement(type) - Location: (6956,6974)(6956,6974)
+ PsiTypeQLElement(label) - Location: (6956,6974)(6956,6974)
+ PsiElement(LABEL_)('stix-domain-object')(6956,6974)
+ PsiElement(',')(',')(6974,6975)
+ PsiWhiteSpace('\n ')(6975,6980)
+ PsiTypeQLOwnsType(type_constraint) - Location: (6980,6996)(6980,6996)
+ PsiElement('owns')('owns')(6980,6984)
+ PsiWhiteSpace(' ')(6984,6985)
+ PsiTypeQLElement(type) - Location: (6985,6996)(6985,6996)
+ PsiTypeQLElement(label) - Location: (6985,6996)(6985,6996)
+ PsiElement(LABEL_)('explanation')(6985,6996)
+ PsiTypeQLElement(annotations_owns) - Location: (6996,6996)(6996,6996)
+
+ PsiElement(',')(',')(6996,6997)
+ PsiWhiteSpace('\n ')(6997,7002)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7002,7014)(7002,7014)
+ PsiElement('owns')('owns')(7002,7006)
+ PsiWhiteSpace(' ')(7006,7007)
+ PsiTypeQLElement(type) - Location: (7007,7014)(7007,7014)
+ PsiTypeQLElement(label) - Location: (7007,7014)(7007,7014)
+ PsiElement(LABEL_)('authors')(7007,7014)
+ PsiTypeQLElement(annotations_owns) - Location: (7014,7014)(7014,7014)
+
+ PsiElement(',')(',')(7014,7015)
+ PsiWhiteSpace('\n ')(7015,7020)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7020,7037)(7020,7037)
+ PsiElement('owns')('owns')(7020,7024)
+ PsiWhiteSpace(' ')(7024,7025)
+ PsiTypeQLElement(type) - Location: (7025,7037)(7025,7037)
+ PsiTypeQLElement(label) - Location: (7025,7037)(7025,7037)
+ PsiElement(LABEL_)('opinion-enum')(7025,7037)
+ PsiTypeQLElement(annotations_owns) - Location: (7037,7037)(7037,7037)
+
+ PsiElement(';')(';')(7037,7038)
+ PsiWhiteSpace('\n\n')(7038,7040)
+ PsiTypeQLElement(definable) - Location: (7040,7221)(7040,7221)
+ PsiTypeQLStatementType(statement_type) - Location: (7040,7221)(7040,7221)
+ PsiTypeQLElement(type_any) - Location: (7040,7053)(7040,7053)
+ PsiTypeQLType(type) - Name: observed-data - Location: (7040,7053)(7040,7053)
+ PsiTypeQLElement(label) - Location: (7040,7053)(7040,7053)
+ PsiElement(LABEL_)('observed-data')(7040,7053)
+ PsiWhiteSpace(' ')(7053,7054)
+ PsiTypeQLSubType(type_constraint) - Location: (7054,7076)(7054,7076)
+ PsiElement(SUB_)('sub')(7054,7057)
+ PsiWhiteSpace(' ')(7057,7058)
+ PsiTypeQLElement(type_any) - Location: (7058,7076)(7058,7076)
+ PsiTypeQLElement(type) - Location: (7058,7076)(7058,7076)
+ PsiTypeQLElement(label) - Location: (7058,7076)(7058,7076)
+ PsiElement(LABEL_)('stix-domain-object')(7058,7076)
+ PsiElement(',')(',')(7076,7077)
+ PsiWhiteSpace('\n ')(7077,7082)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7082,7101)(7082,7101)
+ PsiElement('owns')('owns')(7082,7086)
+ PsiWhiteSpace(' ')(7086,7087)
+ PsiTypeQLElement(type) - Location: (7087,7101)(7087,7101)
+ PsiTypeQLElement(label) - Location: (7087,7101)(7087,7101)
+ PsiElement(LABEL_)('first-observed')(7087,7101)
+ PsiTypeQLElement(annotations_owns) - Location: (7101,7101)(7101,7101)
+
+ PsiElement(',')(',')(7101,7102)
+ PsiWhiteSpace('\n ')(7102,7107)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7107,7125)(7107,7125)
+ PsiElement('owns')('owns')(7107,7111)
+ PsiWhiteSpace(' ')(7111,7112)
+ PsiTypeQLElement(type) - Location: (7112,7125)(7112,7125)
+ PsiTypeQLElement(label) - Location: (7112,7125)(7112,7125)
+ PsiElement(LABEL_)('last-observed')(7112,7125)
+ PsiTypeQLElement(annotations_owns) - Location: (7125,7125)(7125,7125)
+
+ PsiElement(',')(',')(7125,7126)
+ PsiWhiteSpace('\n ')(7126,7131)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7131,7151)(7131,7151)
+ PsiElement('owns')('owns')(7131,7135)
+ PsiWhiteSpace(' ')(7135,7136)
+ PsiTypeQLElement(type) - Location: (7136,7151)(7136,7151)
+ PsiTypeQLElement(label) - Location: (7136,7151)(7136,7151)
+ PsiElement(LABEL_)('number-observed')(7136,7151)
+ PsiTypeQLElement(annotations_owns) - Location: (7151,7151)(7151,7151)
+
+ PsiElement(',')(',')(7151,7152)
+ PsiWhiteSpace('\n\n ')(7152,7158)
+ PsiComment(COMMENT)('# RRel\n')(7158,7165)
+ PsiWhiteSpace(' ')(7165,7169)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7169,7189)(7169,7189)
+ PsiElement('plays')('plays')(7169,7174)
+ PsiWhiteSpace(' ')(7174,7175)
+ PsiTypeQLElement(type_scoped) - Location: (7175,7189)(7175,7189)
+ PsiTypeQLElement(label_scoped) - Location: (7175,7189)(7175,7189)
+ PsiElement(LABEL_SCOPED_)('based-on:based')(7175,7189)
+ PsiElement(',')(',')(7189,7190)
+ PsiWhiteSpace('\n ')(7190,7195)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7195,7221)(7195,7221)
+ PsiElement('plays')('plays')(7195,7200)
+ PsiWhiteSpace(' ')(7200,7201)
+ PsiTypeQLElement(type_scoped) - Location: (7201,7221)(7201,7221)
+ PsiTypeQLElement(label_scoped) - Location: (7201,7221)(7201,7221)
+ PsiElement(LABEL_SCOPED_)('consist-of:consisted')(7201,7221)
+ PsiElement(';')(';')(7221,7222)
+ PsiWhiteSpace('\n\n')(7222,7224)
+ PsiTypeQLElement(definable) - Location: (7224,7332)(7224,7332)
+ PsiTypeQLStatementType(statement_type) - Location: (7224,7332)(7224,7332)
+ PsiTypeQLElement(type_any) - Location: (7224,7230)(7224,7230)
+ PsiTypeQLType(type) - Name: report - Location: (7224,7230)(7224,7230)
+ PsiTypeQLElement(label) - Location: (7224,7230)(7224,7230)
+ PsiElement(LABEL_)('report')(7224,7230)
+ PsiWhiteSpace(' ')(7230,7231)
+ PsiTypeQLSubType(type_constraint) - Location: (7231,7253)(7231,7253)
+ PsiElement(SUB_)('sub')(7231,7234)
+ PsiWhiteSpace(' ')(7234,7235)
+ PsiTypeQLElement(type_any) - Location: (7235,7253)(7235,7253)
+ PsiTypeQLElement(type) - Location: (7235,7253)(7235,7253)
+ PsiTypeQLElement(label) - Location: (7235,7253)(7235,7253)
+ PsiElement(LABEL_)('stix-domain-object')(7235,7253)
+ PsiElement(',')(',')(7253,7254)
+ PsiWhiteSpace('\n ')(7254,7259)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7259,7268)(7259,7268)
+ PsiElement('owns')('owns')(7259,7263)
+ PsiWhiteSpace(' ')(7263,7264)
+ PsiTypeQLElement(type) - Location: (7264,7268)(7264,7268)
+ PsiTypeQLElement(label) - Location: (7264,7268)(7264,7268)
+ PsiElement(LABEL_)('name')(7264,7268)
+ PsiTypeQLElement(annotations_owns) - Location: (7268,7268)(7268,7268)
+
+ PsiElement(',')(',')(7268,7269)
+ PsiWhiteSpace('\n ')(7269,7274)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7274,7290)(7274,7290)
+ PsiElement('owns')('owns')(7274,7278)
+ PsiWhiteSpace(' ')(7278,7279)
+ PsiTypeQLElement(type) - Location: (7279,7290)(7279,7290)
+ PsiTypeQLElement(label) - Location: (7279,7290)(7279,7290)
+ PsiElement(LABEL_)('description')(7279,7290)
+ PsiTypeQLElement(annotations_owns) - Location: (7290,7290)(7290,7290)
+
+ PsiElement(',')(',')(7290,7291)
+ PsiWhiteSpace('\n ')(7291,7296)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7296,7312)(7296,7312)
+ PsiElement('owns')('owns')(7296,7300)
+ PsiWhiteSpace(' ')(7300,7301)
+ PsiTypeQLElement(type) - Location: (7301,7312)(7301,7312)
+ PsiTypeQLElement(label) - Location: (7301,7312)(7301,7312)
+ PsiElement(LABEL_)('report-type')(7301,7312)
+ PsiTypeQLElement(annotations_owns) - Location: (7312,7312)(7312,7312)
+
+ PsiElement(',')(',')(7312,7313)
+ PsiWhiteSpace('\n ')(7313,7318)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7318,7332)(7318,7332)
+ PsiElement('owns')('owns')(7318,7322)
+ PsiWhiteSpace(' ')(7322,7323)
+ PsiTypeQLElement(type) - Location: (7323,7332)(7323,7332)
+ PsiTypeQLElement(label) - Location: (7323,7332)(7323,7332)
+ PsiElement(LABEL_)('published')(7323,7332)
+ PsiTypeQLElement(annotations_owns) - Location: (7332,7332)(7332,7332)
+
+ PsiElement(';')(';')(7332,7333)
+ PsiWhiteSpace('\n\n')(7333,7335)
+ PsiTypeQLElement(definable) - Location: (7335,8062)(7335,8062)
+ PsiTypeQLStatementType(statement_type) - Location: (7335,8062)(7335,8062)
+ PsiTypeQLElement(type_any) - Location: (7335,7347)(7335,7347)
+ PsiTypeQLType(type) - Name: threat-actor - Location: (7335,7347)(7335,7347)
+ PsiTypeQLElement(label) - Location: (7335,7347)(7335,7347)
+ PsiElement(LABEL_)('threat-actor')(7335,7347)
+ PsiWhiteSpace(' ')(7347,7348)
+ PsiTypeQLSubType(type_constraint) - Location: (7348,7370)(7348,7370)
+ PsiElement(SUB_)('sub')(7348,7351)
+ PsiWhiteSpace(' ')(7351,7352)
+ PsiTypeQLElement(type_any) - Location: (7352,7370)(7352,7370)
+ PsiTypeQLElement(type) - Location: (7352,7370)(7352,7370)
+ PsiTypeQLElement(label) - Location: (7352,7370)(7352,7370)
+ PsiElement(LABEL_)('stix-domain-object')(7352,7370)
+ PsiElement(',')(',')(7370,7371)
+ PsiWhiteSpace('\n ')(7371,7376)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7376,7385)(7376,7385)
+ PsiElement('owns')('owns')(7376,7380)
+ PsiWhiteSpace(' ')(7380,7381)
+ PsiTypeQLElement(type) - Location: (7381,7385)(7381,7385)
+ PsiTypeQLElement(label) - Location: (7381,7385)(7381,7385)
+ PsiElement(LABEL_)('name')(7381,7385)
+ PsiTypeQLElement(annotations_owns) - Location: (7385,7385)(7385,7385)
+
+ PsiElement(',')(',')(7385,7386)
+ PsiWhiteSpace('\n ')(7386,7391)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7391,7407)(7391,7407)
+ PsiElement('owns')('owns')(7391,7395)
+ PsiWhiteSpace(' ')(7395,7396)
+ PsiTypeQLElement(type) - Location: (7396,7407)(7396,7407)
+ PsiTypeQLElement(label) - Location: (7396,7407)(7396,7407)
+ PsiElement(LABEL_)('description')(7396,7407)
+ PsiTypeQLElement(annotations_owns) - Location: (7407,7407)(7407,7407)
+
+ PsiElement(',')(',')(7407,7408)
+ PsiWhiteSpace('\n ')(7408,7413)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7413,7425)(7413,7425)
+ PsiElement('owns')('owns')(7413,7417)
+ PsiWhiteSpace(' ')(7417,7418)
+ PsiTypeQLElement(type) - Location: (7418,7425)(7418,7425)
+ PsiTypeQLElement(label) - Location: (7418,7425)(7418,7425)
+ PsiElement(LABEL_)('aliases')(7418,7425)
+ PsiTypeQLElement(annotations_owns) - Location: (7425,7425)(7425,7425)
+
+ PsiElement(',')(',')(7425,7426)
+ PsiWhiteSpace('\n ')(7426,7431)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7431,7445)(7431,7445)
+ PsiElement('owns')('owns')(7431,7435)
+ PsiWhiteSpace(' ')(7435,7436)
+ PsiTypeQLElement(type) - Location: (7436,7445)(7436,7445)
+ PsiTypeQLElement(label) - Location: (7436,7445)(7436,7445)
+ PsiElement(LABEL_)('stix-role')(7436,7445)
+ PsiTypeQLElement(annotations_owns) - Location: (7445,7445)(7445,7445)
+
+ PsiElement(',')(',')(7445,7446)
+ PsiWhiteSpace('\n ')(7446,7451)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7451,7466)(7451,7466)
+ PsiElement('owns')('owns')(7451,7455)
+ PsiWhiteSpace(' ')(7455,7456)
+ PsiTypeQLElement(type) - Location: (7456,7466)(7456,7466)
+ PsiTypeQLElement(label) - Location: (7456,7466)(7456,7466)
+ PsiElement(LABEL_)('first-seen')(7456,7466)
+ PsiTypeQLElement(annotations_owns) - Location: (7466,7466)(7466,7466)
+
+ PsiElement(',')(',')(7466,7467)
+ PsiWhiteSpace('\n ')(7467,7472)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7472,7486)(7472,7486)
+ PsiElement('owns')('owns')(7472,7476)
+ PsiWhiteSpace(' ')(7476,7477)
+ PsiTypeQLElement(type) - Location: (7477,7486)(7477,7486)
+ PsiTypeQLElement(label) - Location: (7477,7486)(7477,7486)
+ PsiElement(LABEL_)('last-seen')(7477,7486)
+ PsiTypeQLElement(annotations_owns) - Location: (7486,7486)(7486,7486)
+
+ PsiElement(',')(',')(7486,7487)
+ PsiWhiteSpace('\n ')(7487,7492)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7492,7502)(7492,7502)
+ PsiElement('owns')('owns')(7492,7496)
+ PsiWhiteSpace(' ')(7496,7497)
+ PsiTypeQLElement(type) - Location: (7497,7502)(7497,7502)
+ PsiTypeQLElement(label) - Location: (7497,7502)(7497,7502)
+ PsiElement(LABEL_)('goals')(7497,7502)
+ PsiTypeQLElement(annotations_owns) - Location: (7502,7502)(7502,7502)
+
+ PsiElement(',')(',')(7502,7503)
+ PsiWhiteSpace('\n ')(7503,7508)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7508,7527)(7508,7527)
+ PsiElement('owns')('owns')(7508,7512)
+ PsiWhiteSpace(' ')(7512,7513)
+ PsiTypeQLElement(type) - Location: (7513,7527)(7513,7527)
+ PsiTypeQLElement(label) - Location: (7513,7527)(7513,7527)
+ PsiElement(LABEL_)('resource-level')(7513,7527)
+ PsiTypeQLElement(annotations_owns) - Location: (7527,7527)(7527,7527)
+
+ PsiElement(',')(',')(7527,7528)
+ PsiWhiteSpace('\n ')(7528,7533)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7533,7556)(7533,7556)
+ PsiElement('owns')('owns')(7533,7537)
+ PsiWhiteSpace(' ')(7537,7538)
+ PsiTypeQLElement(type) - Location: (7538,7556)(7538,7556)
+ PsiTypeQLElement(label) - Location: (7538,7556)(7538,7556)
+ PsiElement(LABEL_)('primary-motivation')(7538,7556)
+ PsiTypeQLElement(annotations_owns) - Location: (7556,7556)(7556,7556)
+
+ PsiElement(',')(',')(7556,7557)
+ PsiWhiteSpace('\n ')(7557,7562)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7562,7588)(7562,7588)
+ PsiElement('owns')('owns')(7562,7566)
+ PsiWhiteSpace(' ')(7566,7567)
+ PsiTypeQLElement(type) - Location: (7567,7588)(7567,7588)
+ PsiTypeQLElement(label) - Location: (7567,7588)(7567,7588)
+ PsiElement(LABEL_)('secondary-motivations')(7567,7588)
+ PsiTypeQLElement(annotations_owns) - Location: (7588,7588)(7588,7588)
+
+ PsiElement(',')(',')(7588,7589)
+ PsiWhiteSpace('\n ')(7589,7594)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7594,7613)(7594,7613)
+ PsiElement('owns')('owns')(7594,7598)
+ PsiWhiteSpace(' ')(7598,7599)
+ PsiTypeQLElement(type) - Location: (7599,7613)(7599,7613)
+ PsiTypeQLElement(label) - Location: (7599,7613)(7599,7613)
+ PsiElement(LABEL_)('sophistication')(7599,7613)
+ PsiTypeQLElement(annotations_owns) - Location: (7613,7613)(7613,7613)
+
+ PsiElement(',')(',')(7613,7614)
+ PsiWhiteSpace('\n ')(7614,7619)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7619,7648)(7619,7648)
+ PsiElement('owns')('owns')(7619,7623)
+ PsiWhiteSpace(' ')(7623,7624)
+ PsiTypeQLElement(type) - Location: (7624,7648)(7624,7648)
+ PsiTypeQLElement(label) - Location: (7624,7648)(7624,7648)
+ PsiElement(LABEL_)('personal-characteristics')(7624,7648)
+ PsiTypeQLElement(annotations_owns) - Location: (7648,7648)(7648,7648)
+
+ PsiElement(',')(',')(7648,7649)
+ PsiWhiteSpace('\n ')(7649,7654)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7654,7664)(7654,7664)
+ PsiElement('owns')('owns')(7654,7658)
+ PsiWhiteSpace(' ')(7658,7659)
+ PsiTypeQLElement(type) - Location: (7659,7664)(7659,7664)
+ PsiTypeQLElement(label) - Location: (7659,7664)(7659,7664)
+ PsiElement(LABEL_)('roles')(7659,7664)
+ PsiTypeQLElement(annotations_owns) - Location: (7664,7664)(7664,7664)
+
+ PsiElement(',')(',')(7664,7665)
+ PsiWhiteSpace('\n ')(7665,7670)
+ PsiTypeQLOwnsType(type_constraint) - Location: (7670,7693)(7670,7693)
+ PsiElement('owns')('owns')(7670,7674)
+ PsiWhiteSpace(' ')(7674,7675)
+ PsiTypeQLElement(type) - Location: (7675,7693)(7675,7693)
+ PsiTypeQLElement(label) - Location: (7675,7693)(7675,7693)
+ PsiElement(LABEL_)('threat-actor-types')(7675,7693)
+ PsiTypeQLElement(annotations_owns) - Location: (7693,7693)(7693,7693)
+
+ PsiElement(',')(',')(7693,7694)
+ PsiWhiteSpace('\n\n ')(7694,7700)
+ PsiComment(COMMENT)('# Rel\n')(7700,7706)
+ PsiWhiteSpace(' ')(7706,7710)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7710,7733)(7710,7733)
+ PsiElement('plays')('plays')(7710,7715)
+ PsiWhiteSpace(' ')(7715,7716)
+ PsiTypeQLElement(type_scoped) - Location: (7716,7733)(7716,7733)
+ PsiTypeQLElement(label_scoped) - Location: (7716,7733)(7716,7733)
+ PsiElement(LABEL_SCOPED_)('targets:targeting')(7716,7733)
+ PsiElement(',')(',')(7733,7734)
+ PsiWhiteSpace('\n ')(7734,7739)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7739,7755)(7739,7755)
+ PsiElement('plays')('plays')(7739,7744)
+ PsiWhiteSpace(' ')(7744,7745)
+ PsiTypeQLElement(type_scoped) - Location: (7745,7755)(7745,7755)
+ PsiTypeQLElement(label_scoped) - Location: (7745,7755)(7745,7755)
+ PsiElement(LABEL_SCOPED_)('uses:using')(7745,7755)
+ PsiElement(',')(',')(7755,7756)
+ PsiWhiteSpace('\n ')(7756,7761)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7761,7792)(7761,7792)
+ PsiElement('plays')('plays')(7761,7766)
+ PsiWhiteSpace(' ')(7766,7767)
+ PsiTypeQLElement(type_scoped) - Location: (7767,7792)(7767,7792)
+ PsiTypeQLElement(label_scoped) - Location: (7767,7792)(7767,7792)
+ PsiElement(LABEL_SCOPED_)('attributed-to:attributing')(7767,7792)
+ PsiElement(',')(',')(7792,7793)
+ PsiWhiteSpace('\n ')(7793,7798)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7798,7828)(7798,7828)
+ PsiElement('plays')('plays')(7798,7803)
+ PsiWhiteSpace(' ')(7803,7804)
+ PsiTypeQLElement(type_scoped) - Location: (7804,7828)(7804,7828)
+ PsiTypeQLElement(label_scoped) - Location: (7804,7828)(7804,7828)
+ PsiElement(LABEL_SCOPED_)('compromises:compromising')(7804,7828)
+ PsiElement(',')(',')(7828,7829)
+ PsiWhiteSpace('\n ')(7829,7834)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7834,7859)(7834,7859)
+ PsiElement('plays')('plays')(7834,7839)
+ PsiWhiteSpace(' ')(7839,7840)
+ PsiTypeQLElement(type_scoped) - Location: (7840,7859)(7840,7859)
+ PsiTypeQLElement(label_scoped) - Location: (7840,7859)(7840,7859)
+ PsiElement(LABEL_SCOPED_)('located-at:locating')(7840,7859)
+ PsiElement(',')(',')(7859,7860)
+ PsiWhiteSpace('\n ')(7860,7865)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7865,7897)(7865,7897)
+ PsiElement('plays')('plays')(7865,7870)
+ PsiWhiteSpace(' ')(7870,7871)
+ PsiTypeQLElement(type_scoped) - Location: (7871,7897)(7871,7897)
+ PsiTypeQLElement(label_scoped) - Location: (7871,7897)(7871,7897)
+ PsiElement(LABEL_SCOPED_)('impersonates:impersonating')(7871,7897)
+ PsiElement(',')(',')(7897,7898)
+ PsiWhiteSpace('\n ')(7898,7903)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7903,7922)(7903,7922)
+ PsiElement('plays')('plays')(7903,7908)
+ PsiWhiteSpace(' ')(7908,7909)
+ PsiTypeQLElement(type_scoped) - Location: (7909,7922)(7909,7922)
+ PsiTypeQLElement(label_scoped) - Location: (7909,7922)(7909,7922)
+ PsiElement(LABEL_SCOPED_)('hosts:hosting')(7909,7922)
+ PsiElement(',')(',')(7922,7923)
+ PsiWhiteSpace('\n ')(7923,7928)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7928,7951)(7928,7951)
+ PsiElement('plays')('plays')(7928,7933)
+ PsiWhiteSpace(' ')(7933,7934)
+ PsiTypeQLElement(type_scoped) - Location: (7934,7951)(7934,7951)
+ PsiTypeQLElement(label_scoped) - Location: (7934,7951)(7934,7951)
+ PsiElement(LABEL_SCOPED_)('ownerships:owning')(7934,7951)
+ PsiElement(',')(',')(7951,7952)
+ PsiWhiteSpace('\n\n ')(7952,7958)
+ PsiComment(COMMENT)('# RRel\n')(7958,7965)
+ PsiWhiteSpace(' ')(7965,7969)
+ PsiTypeQLPlaysType(type_constraint) - Location: (7969,7999)(7969,7999)
+ PsiElement('plays')('plays')(7969,7974)
+ PsiWhiteSpace(' ')(7974,7975)
+ PsiTypeQLElement(type_scoped) - Location: (7975,7999)(7975,7999)
+ PsiTypeQLElement(label_scoped) - Location: (7975,7999)(7975,7999)
+ PsiElement(LABEL_SCOPED_)('attributed-to:attributed')(7975,7999)
+ PsiElement(',')(',')(7999,8000)
+ PsiWhiteSpace('\n ')(8000,8005)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8005,8030)(8005,8030)
+ PsiElement('plays')('plays')(8005,8010)
+ PsiWhiteSpace(' ')(8010,8011)
+ PsiTypeQLElement(type_scoped) - Location: (8011,8030)(8011,8030)
+ PsiTypeQLElement(label_scoped) - Location: (8011,8030)(8011,8030)
+ PsiElement(LABEL_SCOPED_)('indicates:indicated')(8011,8030)
+ PsiElement(',')(',')(8030,8031)
+ PsiWhiteSpace('\n ')(8031,8036)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8036,8062)(8036,8062)
+ PsiElement('plays')('plays')(8036,8041)
+ PsiWhiteSpace(' ')(8041,8042)
+ PsiTypeQLElement(type_scoped) - Location: (8042,8062)(8042,8062)
+ PsiTypeQLElement(label_scoped) - Location: (8042,8062)(8042,8062)
+ PsiElement(LABEL_SCOPED_)('authored-by:authored')(8042,8062)
+ PsiElement(';')(';')(8062,8063)
+ PsiWhiteSpace('\n\n')(8063,8065)
+ PsiTypeQLElement(definable) - Location: (8065,8550)(8065,8550)
+ PsiTypeQLStatementType(statement_type) - Location: (8065,8550)(8065,8550)
+ PsiTypeQLElement(type_any) - Location: (8065,8069)(8065,8069)
+ PsiTypeQLType(type) - Name: tool - Location: (8065,8069)(8065,8069)
+ PsiTypeQLElement(label) - Location: (8065,8069)(8065,8069)
+ PsiElement(LABEL_)('tool')(8065,8069)
+ PsiWhiteSpace(' ')(8069,8070)
+ PsiTypeQLSubType(type_constraint) - Location: (8070,8092)(8070,8092)
+ PsiElement(SUB_)('sub')(8070,8073)
+ PsiWhiteSpace(' ')(8073,8074)
+ PsiTypeQLElement(type_any) - Location: (8074,8092)(8074,8092)
+ PsiTypeQLElement(type) - Location: (8074,8092)(8074,8092)
+ PsiTypeQLElement(label) - Location: (8074,8092)(8074,8092)
+ PsiElement(LABEL_)('stix-domain-object')(8074,8092)
+ PsiElement(',')(',')(8092,8093)
+ PsiWhiteSpace('\n ')(8093,8098)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8098,8107)(8098,8107)
+ PsiElement('owns')('owns')(8098,8102)
+ PsiWhiteSpace(' ')(8102,8103)
+ PsiTypeQLElement(type) - Location: (8103,8107)(8103,8107)
+ PsiTypeQLElement(label) - Location: (8103,8107)(8103,8107)
+ PsiElement(LABEL_)('name')(8103,8107)
+ PsiTypeQLElement(annotations_owns) - Location: (8107,8107)(8107,8107)
+
+ PsiElement(',')(',')(8107,8108)
+ PsiWhiteSpace('\n ')(8108,8113)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8113,8129)(8113,8129)
+ PsiElement('owns')('owns')(8113,8117)
+ PsiWhiteSpace(' ')(8117,8118)
+ PsiTypeQLElement(type) - Location: (8118,8129)(8118,8129)
+ PsiTypeQLElement(label) - Location: (8118,8129)(8118,8129)
+ PsiElement(LABEL_)('description')(8118,8129)
+ PsiTypeQLElement(annotations_owns) - Location: (8129,8129)(8129,8129)
+
+ PsiElement(',')(',')(8129,8130)
+ PsiWhiteSpace('\n ')(8130,8135)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8135,8150)(8135,8150)
+ PsiElement('owns')('owns')(8135,8139)
+ PsiWhiteSpace(' ')(8139,8140)
+ PsiTypeQLElement(type) - Location: (8140,8150)(8140,8150)
+ PsiTypeQLElement(label) - Location: (8140,8150)(8140,8150)
+ PsiElement(LABEL_)('tool-types')(8140,8150)
+ PsiTypeQLElement(annotations_owns) - Location: (8150,8150)(8150,8150)
+
+ PsiElement(',')(',')(8150,8151)
+ PsiWhiteSpace('\n ')(8151,8156)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8156,8168)(8156,8168)
+ PsiElement('owns')('owns')(8156,8160)
+ PsiWhiteSpace(' ')(8160,8161)
+ PsiTypeQLElement(type) - Location: (8161,8168)(8161,8168)
+ PsiTypeQLElement(label) - Location: (8161,8168)(8161,8168)
+ PsiElement(LABEL_)('aliases')(8161,8168)
+ PsiTypeQLElement(annotations_owns) - Location: (8168,8168)(8168,8168)
+
+ PsiElement(',')(',')(8168,8169)
+ PsiWhiteSpace('\n ')(8169,8174)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8174,8189)(8174,8189)
+ PsiElement('owns')('owns')(8174,8178)
+ PsiWhiteSpace(' ')(8178,8179)
+ PsiTypeQLElement(type) - Location: (8179,8189)(8179,8189)
+ PsiTypeQLElement(label) - Location: (8179,8189)(8179,8189)
+ PsiElement(LABEL_)('first-seen')(8179,8189)
+ PsiTypeQLElement(annotations_owns) - Location: (8189,8189)(8189,8189)
+
+ PsiElement(',')(',')(8189,8190)
+ PsiWhiteSpace('\n ')(8190,8195)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8195,8209)(8195,8209)
+ PsiElement('owns')('owns')(8195,8199)
+ PsiWhiteSpace(' ')(8199,8200)
+ PsiTypeQLElement(type) - Location: (8200,8209)(8200,8209)
+ PsiTypeQLElement(label) - Location: (8200,8209)(8200,8209)
+ PsiElement(LABEL_)('last-seen')(8200,8209)
+ PsiTypeQLElement(annotations_owns) - Location: (8209,8209)(8209,8209)
+
+ PsiElement(',')(',')(8209,8210)
+ PsiWhiteSpace('\n ')(8210,8215)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8215,8232)(8215,8232)
+ PsiElement('owns')('owns')(8215,8219)
+ PsiWhiteSpace(' ')(8219,8220)
+ PsiTypeQLElement(type) - Location: (8220,8232)(8220,8232)
+ PsiTypeQLElement(label) - Location: (8220,8232)(8220,8232)
+ PsiElement(LABEL_)('tool-version')(8220,8232)
+ PsiTypeQLElement(annotations_owns) - Location: (8232,8232)(8232,8232)
+
+ PsiElement(',')(',')(8232,8233)
+ PsiWhiteSpace('\n\n ')(8233,8239)
+ PsiComment(COMMENT)('# Rel\n')(8239,8245)
+ PsiWhiteSpace(' ')(8245,8249)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8249,8274)(8249,8274)
+ PsiElement('plays')('plays')(8249,8254)
+ PsiWhiteSpace(' ')(8254,8255)
+ PsiTypeQLElement(type_scoped) - Location: (8255,8274)(8255,8274)
+ PsiTypeQLElement(label_scoped) - Location: (8255,8274)(8255,8274)
+ PsiElement(LABEL_SCOPED_)('delivers:delivering')(8255,8274)
+ PsiElement(',')(',')(8274,8275)
+ PsiWhiteSpace('\n ')(8275,8280)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8280,8303)(8280,8303)
+ PsiElement('plays')('plays')(8280,8285)
+ PsiWhiteSpace(' ')(8285,8286)
+ PsiTypeQLElement(type_scoped) - Location: (8286,8303)(8286,8303)
+ PsiTypeQLElement(label_scoped) - Location: (8286,8303)(8286,8303)
+ PsiElement(LABEL_SCOPED_)('targets:targeting')(8286,8303)
+ PsiElement(',')(',')(8303,8304)
+ PsiWhiteSpace('\n ')(8304,8309)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8309,8325)(8309,8325)
+ PsiElement('plays')('plays')(8309,8314)
+ PsiWhiteSpace(' ')(8314,8315)
+ PsiTypeQLElement(type_scoped) - Location: (8315,8325)(8315,8325)
+ PsiTypeQLElement(label_scoped) - Location: (8315,8325)(8315,8325)
+ PsiElement(LABEL_SCOPED_)('uses:using')(8315,8325)
+ PsiElement(',')(',')(8325,8326)
+ PsiWhiteSpace('\n ')(8326,8331)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8331,8348)(8331,8348)
+ PsiElement('plays')('plays')(8331,8336)
+ PsiWhiteSpace(' ')(8336,8337)
+ PsiTypeQLElement(type_scoped) - Location: (8337,8348)(8337,8348)
+ PsiTypeQLElement(label_scoped) - Location: (8337,8348)(8337,8348)
+ PsiElement(LABEL_SCOPED_)('have:having')(8337,8348)
+ PsiElement(',')(',')(8348,8349)
+ PsiWhiteSpace('\n ')(8349,8354)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8354,8374)(8354,8374)
+ PsiElement('plays')('plays')(8354,8359)
+ PsiWhiteSpace(' ')(8359,8360)
+ PsiTypeQLElement(type_scoped) - Location: (8360,8374)(8360,8374)
+ PsiTypeQLElement(label_scoped) - Location: (8360,8374)(8360,8374)
+ PsiElement(LABEL_SCOPED_)('drops:dropping')(8360,8374)
+ PsiElement(',')(',')(8374,8375)
+ PsiWhiteSpace('\n\n ')(8375,8381)
+ PsiComment(COMMENT)('# RRel\n')(8381,8388)
+ PsiWhiteSpace(' ')(8388,8392)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8392,8407)(8392,8407)
+ PsiElement('plays')('plays')(8392,8397)
+ PsiWhiteSpace(' ')(8397,8398)
+ PsiTypeQLElement(type_scoped) - Location: (8398,8407)(8398,8407)
+ PsiTypeQLElement(label_scoped) - Location: (8398,8407)(8398,8407)
+ PsiElement(LABEL_SCOPED_)('uses:used')(8398,8407)
+ PsiElement(',')(',')(8407,8408)
+ PsiWhiteSpace('\n ')(8408,8413)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8413,8438)(8413,8438)
+ PsiElement('plays')('plays')(8413,8418)
+ PsiWhiteSpace(' ')(8418,8419)
+ PsiTypeQLElement(type_scoped) - Location: (8419,8438)(8419,8438)
+ PsiTypeQLElement(label_scoped) - Location: (8419,8438)(8419,8438)
+ PsiElement(LABEL_SCOPED_)('indicates:indicated')(8419,8438)
+ PsiElement(',')(',')(8438,8439)
+ PsiWhiteSpace('\n ')(8439,8444)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8444,8469)(8444,8469)
+ PsiElement('plays')('plays')(8444,8449)
+ PsiWhiteSpace(' ')(8449,8450)
+ PsiTypeQLElement(type_scoped) - Location: (8450,8469)(8450,8469)
+ PsiTypeQLElement(label_scoped) - Location: (8450,8469)(8450,8469)
+ PsiElement(LABEL_SCOPED_)('mitigates:mitigated')(8450,8469)
+ PsiElement(',')(',')(8469,8470)
+ PsiWhiteSpace('\n ')(8470,8475)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8475,8493)(8475,8493)
+ PsiElement('plays')('plays')(8475,8480)
+ PsiWhiteSpace(' ')(8480,8481)
+ PsiTypeQLElement(type_scoped) - Location: (8481,8493)(8481,8493)
+ PsiTypeQLElement(label_scoped) - Location: (8481,8493)(8481,8493)
+ PsiElement(LABEL_SCOPED_)('hosts:hosted')(8481,8493)
+ PsiElement(',')(',')(8493,8494)
+ PsiWhiteSpace('\n ')(8494,8499)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8499,8525)(8499,8525)
+ PsiElement('plays')('plays')(8499,8504)
+ PsiWhiteSpace(' ')(8504,8505)
+ PsiTypeQLElement(type_scoped) - Location: (8505,8525)(8505,8525)
+ PsiTypeQLElement(label_scoped) - Location: (8505,8525)(8505,8525)
+ PsiElement(LABEL_SCOPED_)('downloads:downloaded')(8505,8525)
+ PsiElement(',')(',')(8525,8526)
+ PsiWhiteSpace('\n ')(8526,8531)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8531,8550)(8531,8550)
+ PsiElement('plays')('plays')(8531,8536)
+ PsiWhiteSpace(' ')(8536,8537)
+ PsiTypeQLElement(type_scoped) - Location: (8537,8550)(8537,8550)
+ PsiTypeQLElement(label_scoped) - Location: (8537,8550)(8537,8550)
+ PsiElement(LABEL_SCOPED_)('drops:dropped')(8537,8550)
+ PsiElement(';')(';')(8550,8551)
+ PsiWhiteSpace('\n\n')(8551,8553)
+ PsiTypeQLElement(definable) - Location: (8553,8862)(8553,8862)
+ PsiTypeQLStatementType(statement_type) - Location: (8553,8862)(8553,8862)
+ PsiTypeQLElement(type_any) - Location: (8553,8566)(8553,8566)
+ PsiTypeQLType(type) - Name: custom-object - Location: (8553,8566)(8553,8566)
+ PsiTypeQLElement(label) - Location: (8553,8566)(8553,8566)
+ PsiElement(LABEL_)('custom-object')(8553,8566)
+ PsiWhiteSpace(' ')(8566,8567)
+ PsiTypeQLSubType(type_constraint) - Location: (8567,8589)(8567,8589)
+ PsiElement(SUB_)('sub')(8567,8570)
+ PsiWhiteSpace(' ')(8570,8571)
+ PsiTypeQLElement(type_any) - Location: (8571,8589)(8571,8589)
+ PsiTypeQLElement(type) - Location: (8571,8589)(8571,8589)
+ PsiTypeQLElement(label) - Location: (8571,8589)(8571,8589)
+ PsiElement(LABEL_)('stix-domain-object')(8571,8589)
+ PsiElement(',')(',')(8589,8590)
+ PsiWhiteSpace('\n ')(8590,8595)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8595,8604)(8595,8604)
+ PsiElement('owns')('owns')(8595,8599)
+ PsiWhiteSpace(' ')(8599,8600)
+ PsiTypeQLElement(type) - Location: (8600,8604)(8600,8604)
+ PsiTypeQLElement(label) - Location: (8600,8604)(8600,8604)
+ PsiElement(LABEL_)('name')(8600,8604)
+ PsiTypeQLElement(annotations_owns) - Location: (8604,8604)(8604,8604)
+
+ PsiElement(',')(',')(8604,8605)
+ PsiWhiteSpace('\n ')(8605,8610)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8610,8626)(8610,8626)
+ PsiElement('owns')('owns')(8610,8614)
+ PsiWhiteSpace(' ')(8614,8615)
+ PsiTypeQLElement(type) - Location: (8615,8626)(8615,8626)
+ PsiTypeQLElement(label) - Location: (8615,8626)(8615,8626)
+ PsiElement(LABEL_)('description')(8615,8626)
+ PsiTypeQLElement(annotations_owns) - Location: (8626,8626)(8626,8626)
+
+ PsiElement(',')(',')(8626,8627)
+ PsiWhiteSpace('\n ')(8627,8632)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8632,8644)(8632,8644)
+ PsiElement('owns')('owns')(8632,8636)
+ PsiWhiteSpace(' ')(8636,8637)
+ PsiTypeQLElement(type) - Location: (8637,8644)(8637,8644)
+ PsiTypeQLElement(label) - Location: (8637,8644)(8637,8644)
+ PsiElement(LABEL_)('aliases')(8637,8644)
+ PsiTypeQLElement(annotations_owns) - Location: (8644,8644)(8644,8644)
+
+ PsiElement(',')(',')(8644,8645)
+ PsiWhiteSpace('\n ')(8645,8650)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8650,8665)(8650,8665)
+ PsiElement('owns')('owns')(8650,8654)
+ PsiWhiteSpace(' ')(8654,8655)
+ PsiTypeQLElement(type) - Location: (8655,8665)(8655,8665)
+ PsiTypeQLElement(label) - Location: (8655,8665)(8655,8665)
+ PsiElement(LABEL_)('first-seen')(8655,8665)
+ PsiTypeQLElement(annotations_owns) - Location: (8665,8665)(8665,8665)
+
+ PsiElement(',')(',')(8665,8666)
+ PsiWhiteSpace('\n ')(8666,8671)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8671,8685)(8671,8685)
+ PsiElement('owns')('owns')(8671,8675)
+ PsiWhiteSpace(' ')(8675,8676)
+ PsiTypeQLElement(type) - Location: (8676,8685)(8676,8685)
+ PsiTypeQLElement(label) - Location: (8676,8685)(8676,8685)
+ PsiElement(LABEL_)('last-seen')(8676,8685)
+ PsiTypeQLElement(annotations_owns) - Location: (8685,8685)(8685,8685)
+
+ PsiElement(',')(',')(8685,8686)
+ PsiWhiteSpace('\n ')(8686,8691)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8691,8705)(8691,8705)
+ PsiElement('owns')('owns')(8691,8695)
+ PsiWhiteSpace(' ')(8695,8696)
+ PsiTypeQLElement(type) - Location: (8696,8705)(8696,8705)
+ PsiTypeQLElement(label) - Location: (8696,8705)(8696,8705)
+ PsiElement(LABEL_)('objective')(8696,8705)
+ PsiTypeQLElement(annotations_owns) - Location: (8705,8705)(8705,8705)
+
+ PsiElement(',')(',')(8705,8706)
+ PsiWhiteSpace('\n\n ')(8706,8712)
+ PsiComment(COMMENT)('# Rel\n')(8712,8718)
+ PsiWhiteSpace(' ')(8718,8722)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8722,8747)(8722,8747)
+ PsiElement('plays')('plays')(8722,8727)
+ PsiWhiteSpace(' ')(8727,8728)
+ PsiTypeQLElement(type_scoped) - Location: (8728,8747)(8728,8747)
+ PsiTypeQLElement(label_scoped) - Location: (8728,8747)(8728,8747)
+ PsiElement(LABEL_SCOPED_)('delivers:delivering')(8728,8747)
+ PsiElement(',')(',')(8747,8748)
+ PsiWhiteSpace('\n ')(8748,8753)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8753,8776)(8753,8776)
+ PsiElement('plays')('plays')(8753,8758)
+ PsiWhiteSpace(' ')(8758,8759)
+ PsiTypeQLElement(type_scoped) - Location: (8759,8776)(8759,8776)
+ PsiTypeQLElement(label_scoped) - Location: (8759,8776)(8759,8776)
+ PsiElement(LABEL_SCOPED_)('targets:targeting')(8759,8776)
+ PsiElement(',')(',')(8776,8777)
+ PsiWhiteSpace('\n ')(8777,8782)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8782,8798)(8782,8798)
+ PsiElement('plays')('plays')(8782,8787)
+ PsiWhiteSpace(' ')(8787,8788)
+ PsiTypeQLElement(type_scoped) - Location: (8788,8798)(8788,8798)
+ PsiTypeQLElement(label_scoped) - Location: (8788,8798)(8788,8798)
+ PsiElement(LABEL_SCOPED_)('uses:using')(8788,8798)
+ PsiElement(',')(',')(8798,8799)
+ PsiWhiteSpace('\n\n ')(8799,8805)
+ PsiComment(COMMENT)('# RRel\n')(8805,8812)
+ PsiWhiteSpace(' ')(8812,8816)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8816,8831)(8816,8831)
+ PsiElement('plays')('plays')(8816,8821)
+ PsiWhiteSpace(' ')(8821,8822)
+ PsiTypeQLElement(type_scoped) - Location: (8822,8831)(8822,8831)
+ PsiTypeQLElement(label_scoped) - Location: (8822,8831)(8822,8831)
+ PsiElement(LABEL_SCOPED_)('uses:used')(8822,8831)
+ PsiElement(',')(',')(8831,8832)
+ PsiWhiteSpace('\n ')(8832,8837)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8837,8862)(8837,8862)
+ PsiElement('plays')('plays')(8837,8842)
+ PsiWhiteSpace(' ')(8842,8843)
+ PsiTypeQLElement(type_scoped) - Location: (8843,8862)(8843,8862)
+ PsiTypeQLElement(label_scoped) - Location: (8843,8862)(8843,8862)
+ PsiElement(LABEL_SCOPED_)('mitigates:mitigated')(8843,8862)
+ PsiElement(';')(';')(8862,8863)
+ PsiWhiteSpace('\n\n')(8863,8865)
+ PsiTypeQLElement(definable) - Location: (8865,9092)(8865,9092)
+ PsiTypeQLStatementType(statement_type) - Location: (8865,9092)(8865,9092)
+ PsiTypeQLElement(type_any) - Location: (8865,8878)(8865,8878)
+ PsiTypeQLType(type) - Name: vulnerability - Location: (8865,8878)(8865,8878)
+ PsiTypeQLElement(label) - Location: (8865,8878)(8865,8878)
+ PsiElement(LABEL_)('vulnerability')(8865,8878)
+ PsiWhiteSpace(' ')(8878,8879)
+ PsiTypeQLSubType(type_constraint) - Location: (8879,8901)(8879,8901)
+ PsiElement(SUB_)('sub')(8879,8882)
+ PsiWhiteSpace(' ')(8882,8883)
+ PsiTypeQLElement(type_any) - Location: (8883,8901)(8883,8901)
+ PsiTypeQLElement(type) - Location: (8883,8901)(8883,8901)
+ PsiTypeQLElement(label) - Location: (8883,8901)(8883,8901)
+ PsiElement(LABEL_)('stix-domain-object')(8883,8901)
+ PsiElement(',')(',')(8901,8902)
+ PsiWhiteSpace('\n ')(8902,8907)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8907,8916)(8907,8916)
+ PsiElement('owns')('owns')(8907,8911)
+ PsiWhiteSpace(' ')(8911,8912)
+ PsiTypeQLElement(type) - Location: (8912,8916)(8912,8916)
+ PsiTypeQLElement(label) - Location: (8912,8916)(8912,8916)
+ PsiElement(LABEL_)('name')(8912,8916)
+ PsiTypeQLElement(annotations_owns) - Location: (8916,8916)(8916,8916)
+
+ PsiElement(',')(',')(8916,8917)
+ PsiWhiteSpace('\n ')(8917,8922)
+ PsiTypeQLOwnsType(type_constraint) - Location: (8922,8938)(8922,8938)
+ PsiElement('owns')('owns')(8922,8926)
+ PsiWhiteSpace(' ')(8926,8927)
+ PsiTypeQLElement(type) - Location: (8927,8938)(8927,8938)
+ PsiTypeQLElement(label) - Location: (8927,8938)(8927,8938)
+ PsiElement(LABEL_)('description')(8927,8938)
+ PsiTypeQLElement(annotations_owns) - Location: (8938,8938)(8938,8938)
+
+ PsiElement(',')(',')(8938,8939)
+ PsiWhiteSpace('\n\n ')(8939,8945)
+ PsiComment(COMMENT)('# RRel\n')(8945,8952)
+ PsiWhiteSpace(' ')(8952,8956)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8956,8978)(8956,8978)
+ PsiElement('plays')('plays')(8956,8961)
+ PsiWhiteSpace(' ')(8961,8962)
+ PsiTypeQLElement(type_scoped) - Location: (8962,8978)(8962,8978)
+ PsiTypeQLElement(label_scoped) - Location: (8962,8978)(8962,8978)
+ PsiElement(LABEL_SCOPED_)('targets:targeted')(8962,8978)
+ PsiElement(',')(',')(8978,8979)
+ PsiWhiteSpace('\n ')(8979,8984)
+ PsiTypeQLPlaysType(type_constraint) - Location: (8984,9009)(8984,9009)
+ PsiElement('plays')('plays')(8984,8989)
+ PsiWhiteSpace(' ')(8989,8990)
+ PsiTypeQLElement(type_scoped) - Location: (8990,9009)(8990,9009)
+ PsiTypeQLElement(label_scoped) - Location: (8990,9009)(8990,9009)
+ PsiElement(LABEL_SCOPED_)('mitigates:mitigated')(8990,9009)
+ PsiElement(',')(',')(9009,9010)
+ PsiWhiteSpace('\n ')(9010,9015)
+ PsiTypeQLPlaysType(type_constraint) - Location: (9015,9042)(9015,9042)
+ PsiElement('plays')('plays')(9015,9020)
+ PsiWhiteSpace(' ')(9020,9021)
+ PsiTypeQLElement(type_scoped) - Location: (9021,9042)(9021,9042)
+ PsiTypeQLElement(label_scoped) - Location: (9021,9042)(9021,9042)
+ PsiElement(LABEL_SCOPED_)('remediates:remediated')(9021,9042)
+ PsiElement(',')(',')(9042,9043)
+ PsiWhiteSpace('\n ')(9043,9048)
+ PsiTypeQLPlaysType(type_constraint) - Location: (9048,9062)(9048,9062)
+ PsiElement('plays')('plays')(9048,9053)
+ PsiWhiteSpace(' ')(9053,9054)
+ PsiTypeQLElement(type_scoped) - Location: (9054,9062)(9054,9062)
+ PsiTypeQLElement(label_scoped) - Location: (9054,9062)(9054,9062)
+ PsiElement(LABEL_SCOPED_)('have:had')(9054,9062)
+ PsiElement(',')(',')(9062,9063)
+ PsiWhiteSpace('\n ')(9063,9068)
+ PsiTypeQLPlaysType(type_constraint) - Location: (9068,9092)(9068,9092)
+ PsiElement('plays')('plays')(9068,9073)
+ PsiWhiteSpace(' ')(9073,9074)
+ PsiTypeQLElement(type_scoped) - Location: (9074,9092)(9074,9092)
+ PsiTypeQLElement(label_scoped) - Location: (9074,9092)(9074,9092)
+ PsiElement(LABEL_SCOPED_)('exploits:exploited')(9074,9092)
+ PsiElement(';')(';')(9092,9093)
+ PsiWhiteSpace('\n\n')(9093,9095)
+ PsiComment(COMMENT)('### 5 SROs ###\n')(9095,9110)
+ PsiTypeQLElement(definable) - Location: (9110,9550)(9110,9550)
+ PsiTypeQLStatementType(statement_type) - Location: (9110,9550)(9110,9550)
+ PsiTypeQLElement(type_any) - Location: (9110,9132)(9110,9132)
+ PsiTypeQLType(type) - Name: stix-core-relationship - Location: (9110,9132)(9110,9132)
+ PsiTypeQLElement(label) - Location: (9110,9132)(9110,9132)
+ PsiElement(LABEL_)('stix-core-relationship')(9110,9132)
+ PsiWhiteSpace(' ')(9132,9133)
+ PsiTypeQLElement(type_constraint) - Location: (9133,9145)(9133,9145)
+ PsiElement(SUB_)('sub')(9133,9136)
+ PsiWhiteSpace(' ')(9136,9137)
+ PsiTypeQLElement(type_any) - Location: (9137,9145)(9137,9145)
+ PsiTypeQLElement(type) - Location: (9137,9145)(9137,9145)
+ PsiTypeQLElement(label) - Location: (9137,9145)(9137,9145)
+ PsiTypeQLElement(type_native) - Location: (9137,9145)(9137,9145)
+ PsiElement('relation')('relation')(9137,9145)
+ PsiElement(',')(',')(9145,9146)
+ PsiWhiteSpace('\n ')(9146,9151)
+ PsiComment(COMMENT)('# Required\n')(9151,9162)
+ PsiWhiteSpace(' ')(9162,9166)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9166,9183)(9166,9183)
+ PsiElement('owns')('owns')(9166,9170)
+ PsiWhiteSpace(' ')(9170,9171)
+ PsiTypeQLElement(type) - Location: (9171,9183)(9171,9183)
+ PsiTypeQLElement(label) - Location: (9171,9183)(9171,9183)
+ PsiElement(LABEL_)('spec-version')(9171,9183)
+ PsiTypeQLElement(annotations_owns) - Location: (9183,9183)(9183,9183)
+
+ PsiElement(',')(',')(9183,9184)
+ PsiWhiteSpace('\n ')(9184,9189)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9189,9206)(9189,9206)
+ PsiElement('owns')('owns')(9189,9193)
+ PsiWhiteSpace(' ')(9193,9194)
+ PsiTypeQLElement(type) - Location: (9194,9201)(9194,9201)
+ PsiTypeQLElement(label) - Location: (9194,9201)(9194,9201)
+ PsiElement(LABEL_)('stix-id')(9194,9201)
+ PsiWhiteSpace(' ')(9201,9202)
+ PsiTypeQLElement(annotations_owns) - Location: (9202,9206)(9202,9206)
+ PsiElement('@key')('@key')(9202,9206)
+ PsiElement(',')(',')(9206,9207)
+ PsiWhiteSpace('\n ')(9207,9212)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9212,9224)(9212,9224)
+ PsiElement('owns')('owns')(9212,9216)
+ PsiWhiteSpace(' ')(9216,9217)
+ PsiTypeQLElement(type) - Location: (9217,9224)(9217,9224)
+ PsiTypeQLElement(label) - Location: (9217,9224)(9217,9224)
+ PsiElement(LABEL_)('created')(9217,9224)
+ PsiTypeQLElement(annotations_owns) - Location: (9224,9224)(9224,9224)
+
+ PsiElement(',')(',')(9224,9225)
+ PsiWhiteSpace('\n ')(9225,9230)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9230,9243)(9230,9243)
+ PsiElement('owns')('owns')(9230,9234)
+ PsiWhiteSpace(' ')(9234,9235)
+ PsiTypeQLElement(type) - Location: (9235,9243)(9235,9243)
+ PsiTypeQLElement(label) - Location: (9235,9243)(9235,9243)
+ PsiElement(LABEL_)('modified')(9235,9243)
+ PsiTypeQLElement(annotations_owns) - Location: (9243,9243)(9243,9243)
+
+ PsiElement(',')(',')(9243,9244)
+ PsiWhiteSpace('\n ')(9244,9249)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9249,9263)(9249,9263)
+ PsiElement('owns')('owns')(9249,9253)
+ PsiWhiteSpace(' ')(9253,9254)
+ PsiTypeQLElement(type) - Location: (9254,9263)(9254,9263)
+ PsiTypeQLElement(label) - Location: (9254,9263)(9254,9263)
+ PsiElement(LABEL_)('stix-type')(9254,9263)
+ PsiTypeQLElement(annotations_owns) - Location: (9263,9263)(9263,9263)
+
+ PsiElement(',')(',')(9263,9264)
+ PsiWhiteSpace('\n\n ')(9264,9270)
+ PsiComment(COMMENT)('# Optional\n')(9270,9281)
+ PsiWhiteSpace(' ')(9281,9285)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9285,9301)(9285,9301)
+ PsiElement('owns')('owns')(9285,9289)
+ PsiWhiteSpace(' ')(9289,9290)
+ PsiTypeQLElement(type) - Location: (9290,9301)(9290,9301)
+ PsiTypeQLElement(label) - Location: (9290,9301)(9290,9301)
+ PsiElement(LABEL_)('description')(9290,9301)
+ PsiTypeQLElement(annotations_owns) - Location: (9301,9301)(9301,9301)
+
+ PsiElement(',')(',')(9301,9302)
+ PsiWhiteSpace('\n ')(9302,9307)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9307,9319)(9307,9319)
+ PsiElement('owns')('owns')(9307,9311)
+ PsiWhiteSpace(' ')(9311,9312)
+ PsiTypeQLElement(type) - Location: (9312,9319)(9312,9319)
+ PsiTypeQLElement(label) - Location: (9312,9319)(9312,9319)
+ PsiElement(LABEL_)('revoked')(9312,9319)
+ PsiTypeQLElement(annotations_owns) - Location: (9319,9319)(9319,9319)
+
+ PsiElement(',')(',')(9319,9320)
+ PsiWhiteSpace('\n ')(9320,9325)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9325,9336)(9325,9336)
+ PsiElement('owns')('owns')(9325,9329)
+ PsiWhiteSpace(' ')(9329,9330)
+ PsiTypeQLElement(type) - Location: (9330,9336)(9330,9336)
+ PsiTypeQLElement(label) - Location: (9330,9336)(9330,9336)
+ PsiElement(LABEL_)('labels')(9330,9336)
+ PsiTypeQLElement(annotations_owns) - Location: (9336,9336)(9336,9336)
+
+ PsiElement(',')(',')(9336,9337)
+ PsiWhiteSpace('\n ')(9337,9342)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9342,9357)(9342,9357)
+ PsiElement('owns')('owns')(9342,9346)
+ PsiWhiteSpace(' ')(9346,9347)
+ PsiTypeQLElement(type) - Location: (9347,9357)(9347,9357)
+ PsiTypeQLElement(label) - Location: (9347,9357)(9347,9357)
+ PsiElement(LABEL_)('confidence')(9347,9357)
+ PsiTypeQLElement(annotations_owns) - Location: (9357,9357)(9357,9357)
+
+ PsiElement(',')(',')(9357,9358)
+ PsiWhiteSpace('\n ')(9358,9363)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9363,9373)(9363,9373)
+ PsiElement('owns')('owns')(9363,9367)
+ PsiWhiteSpace(' ')(9367,9368)
+ PsiTypeQLElement(type) - Location: (9368,9373)(9368,9373)
+ PsiTypeQLElement(label) - Location: (9368,9373)(9368,9373)
+ PsiElement(LABEL_)('langs')(9368,9373)
+ PsiTypeQLElement(annotations_owns) - Location: (9373,9373)(9373,9373)
+
+ PsiElement(',')(',')(9373,9374)
+ PsiWhiteSpace('\n ')(9374,9379)
+ PsiTypeQLOwnsType(type_constraint) - Location: (9379,9400)(9379,9400)
+ PsiElement('owns')('owns')(9379,9383)
+ PsiWhiteSpace(' ')(9383,9384)
+ PsiTypeQLElement(type) - Location: (9384,9400)(9384,9400)
+ PsiTypeQLElement(label) - Location: (9384,9400)(9384,9400)
+ PsiElement(LABEL_)('custom-attribute')(9384,9400)
+ PsiTypeQLElement(annotations_owns) - Location: (9400,9400)(9400,9400)
+
+ PsiElement(',')(',')(9400,9401)
+ PsiWhiteSpace('\n\n ')(9401,9407)
+ PsiTypeQLRelatesType(type_constraint) - Name: source - Location: (9407,9421)(9407,9421)
+ PsiElement('relates')('relates')(9407,9414)
+ PsiWhiteSpace(' ')(9414,9415)
+ PsiTypeQLElement(type) - Location: (9415,9421)(9415,9421)
+ PsiTypeQLElement(label) - Location: (9415,9421)(9415,9421)
+ PsiElement(LABEL_)('source')(9415,9421)
+ PsiElement(',')(',')(9421,9422)
+ PsiWhiteSpace('\n ')(9422,9427)
+ PsiTypeQLRelatesType(type_constraint) - Name: target - Location: (9427,9441)(9427,9441)
+ PsiElement('relates')('relates')(9427,9434)
+ PsiWhiteSpace(' ')(9434,9435)
+ PsiTypeQLElement(type) - Location: (9435,9441)(9435,9441)
+ PsiTypeQLElement(label) - Location: (9435,9441)(9435,9441)
+ PsiElement(LABEL_)('target')(9435,9441)
+ PsiElement(',')(',')(9441,9442)
+ PsiWhiteSpace('\n\n ')(9442,9448)
+ PsiTypeQLPlaysType(type_constraint) - Location: (9448,9472)(9448,9472)
+ PsiElement('plays')('plays')(9448,9453)
+ PsiWhiteSpace(' ')(9453,9454)
+ PsiTypeQLElement(type_scoped) - Location: (9454,9472)(9454,9472)
+ PsiTypeQLElement(label_scoped) - Location: (9454,9472)(9454,9472)
+ PsiElement(LABEL_SCOPED_)('created-by:created')(9454,9472)
+ PsiElement(',')(',')(9472,9473)
+ PsiWhiteSpace('\n ')(9473,9478)
+ PsiTypeQLPlaysType(type_constraint) - Location: (9478,9508)(9478,9508)
+ PsiElement('plays')('plays')(9478,9483)
+ PsiWhiteSpace(' ')(9483,9484)
+ PsiTypeQLElement(type_scoped) - Location: (9484,9508)(9484,9508)
+ PsiTypeQLElement(label_scoped) - Location: (9484,9508)(9484,9508)
+ PsiElement(LABEL_SCOPED_)('granular-marking:marking')(9484,9508)
+ PsiElement(',')(',')(9508,9509)
+ PsiWhiteSpace('\n ')(9509,9514)
+ PsiTypeQLPlaysType(type_constraint) - Location: (9514,9550)(9514,9550)
+ PsiElement('plays')('plays')(9514,9519)
+ PsiWhiteSpace(' ')(9519,9520)
+ PsiTypeQLElement(type_scoped) - Location: (9520,9550)(9520,9550)
+ PsiTypeQLElement(label_scoped) - Location: (9520,9550)(9520,9550)
+ PsiElement(LABEL_SCOPED_)('external-references:referenced')(9520,9550)
+ PsiElement(';')(';')(9550,9551)
+ PsiWhiteSpace('\n\n')(9551,9553)
+ PsiTypeQLElement(definable) - Location: (9553,9655)(9553,9655)
+ PsiTypeQLStatementType(statement_type) - Location: (9553,9655)(9553,9655)
+ PsiTypeQLElement(type_any) - Location: (9553,9561)(9553,9561)
+ PsiTypeQLType(type) - Name: delivers - Location: (9553,9561)(9553,9561)
+ PsiTypeQLElement(label) - Location: (9553,9561)(9553,9561)
+ PsiElement(LABEL_)('delivers')(9553,9561)
+ PsiWhiteSpace(' ')(9561,9562)
+ PsiTypeQLSubType(type_constraint) - Location: (9562,9588)(9562,9588)
+ PsiElement(SUB_)('sub')(9562,9565)
+ PsiWhiteSpace(' ')(9565,9566)
+ PsiTypeQLElement(type_any) - Location: (9566,9588)(9566,9588)
+ PsiTypeQLElement(type) - Location: (9566,9588)(9566,9588)
+ PsiTypeQLElement(label) - Location: (9566,9588)(9566,9588)
+ PsiElement(LABEL_)('stix-core-relationship')(9566,9588)
+ PsiElement(',')(',')(9588,9589)
+ PsiWhiteSpace('\n ')(9589,9594)
+ PsiTypeQLRelatesType(type_constraint) - Name: delivering - Location: (9594,9612)(9594,9622)
+ PsiElement('relates')('relates')(9594,9601)
+ PsiWhiteSpace(' ')(9601,9602)
+ PsiTypeQLElement(type) - Location: (9602,9612)(9602,9612)
+ PsiTypeQLElement(label) - Location: (9602,9612)(9602,9612)
+ PsiElement(LABEL_)('delivering')(9602,9612)
+ PsiWhiteSpace(' ')(9612,9613)
+ PsiElement('as')('as')(9613,9615)
+ PsiWhiteSpace(' ')(9615,9616)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (9616,9622)(9616,9622)
+ PsiTypeQLElement(label) - Location: (9616,9622)(9616,9622)
+ PsiElement(LABEL_)('source')(9616,9622)
+ PsiElement(',')(',')(9622,9623)
+ PsiWhiteSpace('\n ')(9623,9628)
+ PsiTypeQLRelatesType(type_constraint) - Name: delivered - Location: (9628,9645)(9628,9655)
+ PsiElement('relates')('relates')(9628,9635)
+ PsiWhiteSpace(' ')(9635,9636)
+ PsiTypeQLElement(type) - Location: (9636,9645)(9636,9645)
+ PsiTypeQLElement(label) - Location: (9636,9645)(9636,9645)
+ PsiElement(LABEL_)('delivered')(9636,9645)
+ PsiWhiteSpace(' ')(9645,9646)
+ PsiElement('as')('as')(9646,9648)
+ PsiWhiteSpace(' ')(9648,9649)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (9649,9655)(9649,9655)
+ PsiTypeQLElement(label) - Location: (9649,9655)(9649,9655)
+ PsiElement(LABEL_)('target')(9649,9655)
+ PsiElement(';')(';')(9655,9656)
+ PsiWhiteSpace('\n\n')(9656,9658)
+ PsiTypeQLElement(definable) - Location: (9658,9757)(9658,9757)
+ PsiTypeQLStatementType(statement_type) - Location: (9658,9757)(9658,9757)
+ PsiTypeQLElement(type_any) - Location: (9658,9665)(9658,9665)
+ PsiTypeQLType(type) - Name: targets - Location: (9658,9665)(9658,9665)
+ PsiTypeQLElement(label) - Location: (9658,9665)(9658,9665)
+ PsiElement(LABEL_)('targets')(9658,9665)
+ PsiWhiteSpace(' ')(9665,9666)
+ PsiTypeQLSubType(type_constraint) - Location: (9666,9692)(9666,9692)
+ PsiElement(SUB_)('sub')(9666,9669)
+ PsiWhiteSpace(' ')(9669,9670)
+ PsiTypeQLElement(type_any) - Location: (9670,9692)(9670,9692)
+ PsiTypeQLElement(type) - Location: (9670,9692)(9670,9692)
+ PsiTypeQLElement(label) - Location: (9670,9692)(9670,9692)
+ PsiElement(LABEL_)('stix-core-relationship')(9670,9692)
+ PsiElement(',')(',')(9692,9693)
+ PsiWhiteSpace('\n ')(9693,9698)
+ PsiTypeQLRelatesType(type_constraint) - Name: targeting - Location: (9698,9715)(9698,9725)
+ PsiElement('relates')('relates')(9698,9705)
+ PsiWhiteSpace(' ')(9705,9706)
+ PsiTypeQLElement(type) - Location: (9706,9715)(9706,9715)
+ PsiTypeQLElement(label) - Location: (9706,9715)(9706,9715)
+ PsiElement(LABEL_)('targeting')(9706,9715)
+ PsiWhiteSpace(' ')(9715,9716)
+ PsiElement('as')('as')(9716,9718)
+ PsiWhiteSpace(' ')(9718,9719)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (9719,9725)(9719,9725)
+ PsiTypeQLElement(label) - Location: (9719,9725)(9719,9725)
+ PsiElement(LABEL_)('source')(9719,9725)
+ PsiElement(',')(',')(9725,9726)
+ PsiWhiteSpace('\n ')(9726,9731)
+ PsiTypeQLRelatesType(type_constraint) - Name: targeted - Location: (9731,9747)(9731,9757)
+ PsiElement('relates')('relates')(9731,9738)
+ PsiWhiteSpace(' ')(9738,9739)
+ PsiTypeQLElement(type) - Location: (9739,9747)(9739,9747)
+ PsiTypeQLElement(label) - Location: (9739,9747)(9739,9747)
+ PsiElement(LABEL_)('targeted')(9739,9747)
+ PsiWhiteSpace(' ')(9747,9748)
+ PsiElement('as')('as')(9748,9750)
+ PsiWhiteSpace(' ')(9750,9751)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (9751,9757)(9751,9757)
+ PsiTypeQLElement(label) - Location: (9751,9757)(9751,9757)
+ PsiElement(LABEL_)('target')(9751,9757)
+ PsiElement(';')(';')(9757,9758)
+ PsiWhiteSpace('\n\n')(9758,9760)
+ PsiTypeQLElement(definable) - Location: (9760,9869)(9760,9869)
+ PsiTypeQLStatementType(statement_type) - Location: (9760,9869)(9760,9869)
+ PsiTypeQLElement(type_any) - Location: (9760,9773)(9760,9773)
+ PsiTypeQLType(type) - Name: attributed-to - Location: (9760,9773)(9760,9773)
+ PsiTypeQLElement(label) - Location: (9760,9773)(9760,9773)
+ PsiElement(LABEL_)('attributed-to')(9760,9773)
+ PsiWhiteSpace(' ')(9773,9774)
+ PsiTypeQLSubType(type_constraint) - Location: (9774,9800)(9774,9800)
+ PsiElement(SUB_)('sub')(9774,9777)
+ PsiWhiteSpace(' ')(9777,9778)
+ PsiTypeQLElement(type_any) - Location: (9778,9800)(9778,9800)
+ PsiTypeQLElement(type) - Location: (9778,9800)(9778,9800)
+ PsiTypeQLElement(label) - Location: (9778,9800)(9778,9800)
+ PsiElement(LABEL_)('stix-core-relationship')(9778,9800)
+ PsiElement(',')(',')(9800,9801)
+ PsiWhiteSpace('\n ')(9801,9806)
+ PsiTypeQLRelatesType(type_constraint) - Name: attributing - Location: (9806,9825)(9806,9835)
+ PsiElement('relates')('relates')(9806,9813)
+ PsiWhiteSpace(' ')(9813,9814)
+ PsiTypeQLElement(type) - Location: (9814,9825)(9814,9825)
+ PsiTypeQLElement(label) - Location: (9814,9825)(9814,9825)
+ PsiElement(LABEL_)('attributing')(9814,9825)
+ PsiWhiteSpace(' ')(9825,9826)
+ PsiElement('as')('as')(9826,9828)
+ PsiWhiteSpace(' ')(9828,9829)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (9829,9835)(9829,9835)
+ PsiTypeQLElement(label) - Location: (9829,9835)(9829,9835)
+ PsiElement(LABEL_)('source')(9829,9835)
+ PsiElement(',')(',')(9835,9836)
+ PsiWhiteSpace('\n ')(9836,9841)
+ PsiTypeQLRelatesType(type_constraint) - Name: attributed - Location: (9841,9859)(9841,9869)
+ PsiElement('relates')('relates')(9841,9848)
+ PsiWhiteSpace(' ')(9848,9849)
+ PsiTypeQLElement(type) - Location: (9849,9859)(9849,9859)
+ PsiTypeQLElement(label) - Location: (9849,9859)(9849,9859)
+ PsiElement(LABEL_)('attributed')(9849,9859)
+ PsiWhiteSpace(' ')(9859,9860)
+ PsiElement('as')('as')(9860,9862)
+ PsiWhiteSpace(' ')(9862,9863)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (9863,9869)(9863,9869)
+ PsiTypeQLElement(label) - Location: (9863,9869)(9863,9869)
+ PsiElement(LABEL_)('target')(9863,9869)
+ PsiElement(';')(';')(9869,9870)
+ PsiWhiteSpace('\n\n')(9870,9872)
+ PsiTypeQLElement(definable) - Location: (9872,9960)(9872,9960)
+ PsiTypeQLStatementType(statement_type) - Location: (9872,9960)(9872,9960)
+ PsiTypeQLElement(type_any) - Location: (9872,9876)(9872,9876)
+ PsiTypeQLType(type) - Name: uses - Location: (9872,9876)(9872,9876)
+ PsiTypeQLElement(label) - Location: (9872,9876)(9872,9876)
+ PsiElement(LABEL_)('uses')(9872,9876)
+ PsiWhiteSpace(' ')(9876,9877)
+ PsiTypeQLSubType(type_constraint) - Location: (9877,9903)(9877,9903)
+ PsiElement(SUB_)('sub')(9877,9880)
+ PsiWhiteSpace(' ')(9880,9881)
+ PsiTypeQLElement(type_any) - Location: (9881,9903)(9881,9903)
+ PsiTypeQLElement(type) - Location: (9881,9903)(9881,9903)
+ PsiTypeQLElement(label) - Location: (9881,9903)(9881,9903)
+ PsiElement(LABEL_)('stix-core-relationship')(9881,9903)
+ PsiElement(',')(',')(9903,9904)
+ PsiWhiteSpace('\n ')(9904,9909)
+ PsiTypeQLRelatesType(type_constraint) - Name: using - Location: (9909,9922)(9909,9932)
+ PsiElement('relates')('relates')(9909,9916)
+ PsiWhiteSpace(' ')(9916,9917)
+ PsiTypeQLElement(type) - Location: (9917,9922)(9917,9922)
+ PsiTypeQLElement(label) - Location: (9917,9922)(9917,9922)
+ PsiElement(LABEL_)('using')(9917,9922)
+ PsiWhiteSpace(' ')(9922,9923)
+ PsiElement('as')('as')(9923,9925)
+ PsiWhiteSpace(' ')(9925,9926)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (9926,9932)(9926,9932)
+ PsiTypeQLElement(label) - Location: (9926,9932)(9926,9932)
+ PsiElement(LABEL_)('source')(9926,9932)
+ PsiElement(',')(',')(9932,9933)
+ PsiWhiteSpace('\n ')(9933,9938)
+ PsiTypeQLRelatesType(type_constraint) - Name: used - Location: (9938,9950)(9938,9960)
+ PsiElement('relates')('relates')(9938,9945)
+ PsiWhiteSpace(' ')(9945,9946)
+ PsiTypeQLElement(type) - Location: (9946,9950)(9946,9950)
+ PsiTypeQLElement(label) - Location: (9946,9950)(9946,9950)
+ PsiElement(LABEL_)('used')(9946,9950)
+ PsiWhiteSpace(' ')(9950,9951)
+ PsiElement('as')('as')(9951,9953)
+ PsiWhiteSpace(' ')(9953,9954)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (9954,9960)(9954,9960)
+ PsiTypeQLElement(label) - Location: (9954,9960)(9954,9960)
+ PsiElement(LABEL_)('target')(9954,9960)
+ PsiElement(';')(';')(9960,9961)
+ PsiWhiteSpace('\n\n')(9961,9963)
+ PsiTypeQLElement(definable) - Location: (9963,10066)(9963,10066)
+ PsiTypeQLStatementType(statement_type) - Location: (9963,10066)(9963,10066)
+ PsiTypeQLElement(type_any) - Location: (9963,9972)(9963,9972)
+ PsiTypeQLType(type) - Name: indicates - Location: (9963,9972)(9963,9972)
+ PsiTypeQLElement(label) - Location: (9963,9972)(9963,9972)
+ PsiElement(LABEL_)('indicates')(9963,9972)
+ PsiWhiteSpace(' ')(9972,9973)
+ PsiTypeQLSubType(type_constraint) - Location: (9973,9999)(9973,9999)
+ PsiElement(SUB_)('sub')(9973,9976)
+ PsiWhiteSpace(' ')(9976,9977)
+ PsiTypeQLElement(type_any) - Location: (9977,9999)(9977,9999)
+ PsiTypeQLElement(type) - Location: (9977,9999)(9977,9999)
+ PsiTypeQLElement(label) - Location: (9977,9999)(9977,9999)
+ PsiElement(LABEL_)('stix-core-relationship')(9977,9999)
+ PsiElement(',')(',')(9999,10000)
+ PsiWhiteSpace('\n ')(10000,10005)
+ PsiTypeQLRelatesType(type_constraint) - Name: indicating - Location: (10005,10023)(10005,10033)
+ PsiElement('relates')('relates')(10005,10012)
+ PsiWhiteSpace(' ')(10012,10013)
+ PsiTypeQLElement(type) - Location: (10013,10023)(10013,10023)
+ PsiTypeQLElement(label) - Location: (10013,10023)(10013,10023)
+ PsiElement(LABEL_)('indicating')(10013,10023)
+ PsiWhiteSpace(' ')(10023,10024)
+ PsiElement('as')('as')(10024,10026)
+ PsiWhiteSpace(' ')(10026,10027)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10027,10033)(10027,10033)
+ PsiTypeQLElement(label) - Location: (10027,10033)(10027,10033)
+ PsiElement(LABEL_)('source')(10027,10033)
+ PsiElement(',')(',')(10033,10034)
+ PsiWhiteSpace('\n ')(10034,10039)
+ PsiTypeQLRelatesType(type_constraint) - Name: indicated - Location: (10039,10056)(10039,10066)
+ PsiElement('relates')('relates')(10039,10046)
+ PsiWhiteSpace(' ')(10046,10047)
+ PsiTypeQLElement(type) - Location: (10047,10056)(10047,10056)
+ PsiTypeQLElement(label) - Location: (10047,10056)(10047,10056)
+ PsiElement(LABEL_)('indicated')(10047,10056)
+ PsiWhiteSpace(' ')(10056,10057)
+ PsiElement('as')('as')(10057,10059)
+ PsiWhiteSpace(' ')(10059,10060)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10060,10066)(10060,10066)
+ PsiTypeQLElement(label) - Location: (10060,10066)(10060,10066)
+ PsiElement(LABEL_)('target')(10060,10066)
+ PsiElement(';')(';')(10066,10067)
+ PsiWhiteSpace('\n\n')(10067,10069)
+ PsiTypeQLElement(definable) - Location: (10069,10178)(10069,10178)
+ PsiTypeQLStatementType(statement_type) - Location: (10069,10178)(10069,10178)
+ PsiTypeQLElement(type_any) - Location: (10069,10080)(10069,10080)
+ PsiTypeQLType(type) - Name: compromises - Location: (10069,10080)(10069,10080)
+ PsiTypeQLElement(label) - Location: (10069,10080)(10069,10080)
+ PsiElement(LABEL_)('compromises')(10069,10080)
+ PsiWhiteSpace(' ')(10080,10081)
+ PsiTypeQLSubType(type_constraint) - Location: (10081,10107)(10081,10107)
+ PsiElement(SUB_)('sub')(10081,10084)
+ PsiWhiteSpace(' ')(10084,10085)
+ PsiTypeQLElement(type_any) - Location: (10085,10107)(10085,10107)
+ PsiTypeQLElement(type) - Location: (10085,10107)(10085,10107)
+ PsiTypeQLElement(label) - Location: (10085,10107)(10085,10107)
+ PsiElement(LABEL_)('stix-core-relationship')(10085,10107)
+ PsiElement(',')(',')(10107,10108)
+ PsiWhiteSpace('\n ')(10108,10113)
+ PsiTypeQLRelatesType(type_constraint) - Name: compromising - Location: (10113,10133)(10113,10143)
+ PsiElement('relates')('relates')(10113,10120)
+ PsiWhiteSpace(' ')(10120,10121)
+ PsiTypeQLElement(type) - Location: (10121,10133)(10121,10133)
+ PsiTypeQLElement(label) - Location: (10121,10133)(10121,10133)
+ PsiElement(LABEL_)('compromising')(10121,10133)
+ PsiWhiteSpace(' ')(10133,10134)
+ PsiElement('as')('as')(10134,10136)
+ PsiWhiteSpace(' ')(10136,10137)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10137,10143)(10137,10143)
+ PsiTypeQLElement(label) - Location: (10137,10143)(10137,10143)
+ PsiElement(LABEL_)('source')(10137,10143)
+ PsiElement(',')(',')(10143,10144)
+ PsiWhiteSpace('\n ')(10144,10149)
+ PsiTypeQLRelatesType(type_constraint) - Name: compromised - Location: (10149,10168)(10149,10178)
+ PsiElement('relates')('relates')(10149,10156)
+ PsiWhiteSpace(' ')(10156,10157)
+ PsiTypeQLElement(type) - Location: (10157,10168)(10157,10168)
+ PsiTypeQLElement(label) - Location: (10157,10168)(10157,10168)
+ PsiElement(LABEL_)('compromised')(10157,10168)
+ PsiWhiteSpace(' ')(10168,10169)
+ PsiElement('as')('as')(10169,10171)
+ PsiWhiteSpace(' ')(10171,10172)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10172,10178)(10172,10178)
+ PsiTypeQLElement(label) - Location: (10172,10178)(10172,10178)
+ PsiElement(LABEL_)('target')(10172,10178)
+ PsiElement(';')(';')(10178,10179)
+ PsiWhiteSpace('\n\n')(10179,10181)
+ PsiTypeQLElement(definable) - Location: (10181,10292)(10181,10292)
+ PsiTypeQLStatementType(statement_type) - Location: (10181,10292)(10181,10292)
+ PsiTypeQLElement(type_any) - Location: (10181,10196)(10181,10196)
+ PsiTypeQLType(type) - Name: originates-from - Location: (10181,10196)(10181,10196)
+ PsiTypeQLElement(label) - Location: (10181,10196)(10181,10196)
+ PsiElement(LABEL_)('originates-from')(10181,10196)
+ PsiWhiteSpace(' ')(10196,10197)
+ PsiTypeQLSubType(type_constraint) - Location: (10197,10223)(10197,10223)
+ PsiElement(SUB_)('sub')(10197,10200)
+ PsiWhiteSpace(' ')(10200,10201)
+ PsiTypeQLElement(type_any) - Location: (10201,10223)(10201,10223)
+ PsiTypeQLElement(type) - Location: (10201,10223)(10201,10223)
+ PsiTypeQLElement(label) - Location: (10201,10223)(10201,10223)
+ PsiElement(LABEL_)('stix-core-relationship')(10201,10223)
+ PsiElement(',')(',')(10223,10224)
+ PsiWhiteSpace('\n ')(10224,10229)
+ PsiTypeQLRelatesType(type_constraint) - Name: originating - Location: (10229,10248)(10229,10258)
+ PsiElement('relates')('relates')(10229,10236)
+ PsiWhiteSpace(' ')(10236,10237)
+ PsiTypeQLElement(type) - Location: (10237,10248)(10237,10248)
+ PsiTypeQLElement(label) - Location: (10237,10248)(10237,10248)
+ PsiElement(LABEL_)('originating')(10237,10248)
+ PsiWhiteSpace(' ')(10248,10249)
+ PsiElement('as')('as')(10249,10251)
+ PsiWhiteSpace(' ')(10251,10252)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10252,10258)(10252,10258)
+ PsiTypeQLElement(label) - Location: (10252,10258)(10252,10258)
+ PsiElement(LABEL_)('source')(10252,10258)
+ PsiElement(',')(',')(10258,10259)
+ PsiWhiteSpace('\n ')(10259,10264)
+ PsiTypeQLRelatesType(type_constraint) - Name: originated - Location: (10264,10282)(10264,10292)
+ PsiElement('relates')('relates')(10264,10271)
+ PsiWhiteSpace(' ')(10271,10272)
+ PsiTypeQLElement(type) - Location: (10272,10282)(10272,10282)
+ PsiTypeQLElement(label) - Location: (10272,10282)(10272,10282)
+ PsiElement(LABEL_)('originated')(10272,10282)
+ PsiWhiteSpace(' ')(10282,10283)
+ PsiElement('as')('as')(10283,10285)
+ PsiWhiteSpace(' ')(10285,10286)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10286,10292)(10286,10292)
+ PsiTypeQLElement(label) - Location: (10286,10292)(10286,10292)
+ PsiElement(LABEL_)('target')(10286,10292)
+ PsiElement(';')(';')(10292,10293)
+ PsiWhiteSpace('\n\n')(10293,10295)
+ PsiTypeQLElement(definable) - Location: (10295,10407)(10295,10407)
+ PsiTypeQLStatementType(statement_type) - Location: (10295,10407)(10295,10407)
+ PsiTypeQLElement(type_any) - Location: (10295,10307)(10295,10307)
+ PsiTypeQLType(type) - Name: investigates - Location: (10295,10307)(10295,10307)
+ PsiTypeQLElement(label) - Location: (10295,10307)(10295,10307)
+ PsiElement(LABEL_)('investigates')(10295,10307)
+ PsiWhiteSpace(' ')(10307,10308)
+ PsiTypeQLSubType(type_constraint) - Location: (10308,10334)(10308,10334)
+ PsiElement(SUB_)('sub')(10308,10311)
+ PsiWhiteSpace(' ')(10311,10312)
+ PsiTypeQLElement(type_any) - Location: (10312,10334)(10312,10334)
+ PsiTypeQLElement(type) - Location: (10312,10334)(10312,10334)
+ PsiTypeQLElement(label) - Location: (10312,10334)(10312,10334)
+ PsiElement(LABEL_)('stix-core-relationship')(10312,10334)
+ PsiElement(',')(',')(10334,10335)
+ PsiWhiteSpace('\n ')(10335,10340)
+ PsiTypeQLRelatesType(type_constraint) - Name: investigating - Location: (10340,10361)(10340,10371)
+ PsiElement('relates')('relates')(10340,10347)
+ PsiWhiteSpace(' ')(10347,10348)
+ PsiTypeQLElement(type) - Location: (10348,10361)(10348,10361)
+ PsiTypeQLElement(label) - Location: (10348,10361)(10348,10361)
+ PsiElement(LABEL_)('investigating')(10348,10361)
+ PsiWhiteSpace(' ')(10361,10362)
+ PsiElement('as')('as')(10362,10364)
+ PsiWhiteSpace(' ')(10364,10365)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10365,10371)(10365,10371)
+ PsiTypeQLElement(label) - Location: (10365,10371)(10365,10371)
+ PsiElement(LABEL_)('source')(10365,10371)
+ PsiElement(',')(',')(10371,10372)
+ PsiWhiteSpace('\n ')(10372,10377)
+ PsiTypeQLRelatesType(type_constraint) - Name: investigated - Location: (10377,10397)(10377,10407)
+ PsiElement('relates')('relates')(10377,10384)
+ PsiWhiteSpace(' ')(10384,10385)
+ PsiTypeQLElement(type) - Location: (10385,10397)(10385,10397)
+ PsiTypeQLElement(label) - Location: (10385,10397)(10385,10397)
+ PsiElement(LABEL_)('investigated')(10385,10397)
+ PsiWhiteSpace(' ')(10397,10398)
+ PsiElement('as')('as')(10398,10400)
+ PsiWhiteSpace(' ')(10400,10401)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10401,10407)(10401,10407)
+ PsiTypeQLElement(label) - Location: (10401,10407)(10401,10407)
+ PsiElement(LABEL_)('target')(10401,10407)
+ PsiElement(';')(';')(10407,10408)
+ PsiWhiteSpace('\n\n')(10408,10410)
+ PsiTypeQLElement(definable) - Location: (10410,10513)(10410,10513)
+ PsiTypeQLStatementType(statement_type) - Location: (10410,10513)(10410,10513)
+ PsiTypeQLElement(type_any) - Location: (10410,10419)(10410,10419)
+ PsiTypeQLType(type) - Name: mitigates - Location: (10410,10419)(10410,10419)
+ PsiTypeQLElement(label) - Location: (10410,10419)(10410,10419)
+ PsiElement(LABEL_)('mitigates')(10410,10419)
+ PsiWhiteSpace(' ')(10419,10420)
+ PsiTypeQLSubType(type_constraint) - Location: (10420,10446)(10420,10446)
+ PsiElement(SUB_)('sub')(10420,10423)
+ PsiWhiteSpace(' ')(10423,10424)
+ PsiTypeQLElement(type_any) - Location: (10424,10446)(10424,10446)
+ PsiTypeQLElement(type) - Location: (10424,10446)(10424,10446)
+ PsiTypeQLElement(label) - Location: (10424,10446)(10424,10446)
+ PsiElement(LABEL_)('stix-core-relationship')(10424,10446)
+ PsiElement(',')(',')(10446,10447)
+ PsiWhiteSpace('\n ')(10447,10452)
+ PsiTypeQLRelatesType(type_constraint) - Name: mitigating - Location: (10452,10470)(10452,10480)
+ PsiElement('relates')('relates')(10452,10459)
+ PsiWhiteSpace(' ')(10459,10460)
+ PsiTypeQLElement(type) - Location: (10460,10470)(10460,10470)
+ PsiTypeQLElement(label) - Location: (10460,10470)(10460,10470)
+ PsiElement(LABEL_)('mitigating')(10460,10470)
+ PsiWhiteSpace(' ')(10470,10471)
+ PsiElement('as')('as')(10471,10473)
+ PsiWhiteSpace(' ')(10473,10474)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10474,10480)(10474,10480)
+ PsiTypeQLElement(label) - Location: (10474,10480)(10474,10480)
+ PsiElement(LABEL_)('source')(10474,10480)
+ PsiElement(',')(',')(10480,10481)
+ PsiWhiteSpace('\n ')(10481,10486)
+ PsiTypeQLRelatesType(type_constraint) - Name: mitigated - Location: (10486,10503)(10486,10513)
+ PsiElement('relates')('relates')(10486,10493)
+ PsiWhiteSpace(' ')(10493,10494)
+ PsiTypeQLElement(type) - Location: (10494,10503)(10494,10503)
+ PsiTypeQLElement(label) - Location: (10494,10503)(10494,10503)
+ PsiElement(LABEL_)('mitigated')(10494,10503)
+ PsiWhiteSpace(' ')(10503,10504)
+ PsiElement('as')('as')(10504,10506)
+ PsiWhiteSpace(' ')(10506,10507)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10507,10513)(10507,10513)
+ PsiTypeQLElement(label) - Location: (10507,10513)(10507,10513)
+ PsiElement(LABEL_)('target')(10507,10513)
+ PsiElement(';')(';')(10513,10514)
+ PsiWhiteSpace('\n\n')(10514,10516)
+ PsiTypeQLElement(definable) - Location: (10516,10622)(10516,10622)
+ PsiTypeQLStatementType(statement_type) - Location: (10516,10622)(10516,10622)
+ PsiTypeQLElement(type_any) - Location: (10516,10526)(10516,10526)
+ PsiTypeQLType(type) - Name: remediates - Location: (10516,10526)(10516,10526)
+ PsiTypeQLElement(label) - Location: (10516,10526)(10516,10526)
+ PsiElement(LABEL_)('remediates')(10516,10526)
+ PsiWhiteSpace(' ')(10526,10527)
+ PsiTypeQLSubType(type_constraint) - Location: (10527,10553)(10527,10553)
+ PsiElement(SUB_)('sub')(10527,10530)
+ PsiWhiteSpace(' ')(10530,10531)
+ PsiTypeQLElement(type_any) - Location: (10531,10553)(10531,10553)
+ PsiTypeQLElement(type) - Location: (10531,10553)(10531,10553)
+ PsiTypeQLElement(label) - Location: (10531,10553)(10531,10553)
+ PsiElement(LABEL_)('stix-core-relationship')(10531,10553)
+ PsiElement(',')(',')(10553,10554)
+ PsiWhiteSpace('\n ')(10554,10559)
+ PsiTypeQLRelatesType(type_constraint) - Name: remediating - Location: (10559,10578)(10559,10588)
+ PsiElement('relates')('relates')(10559,10566)
+ PsiWhiteSpace(' ')(10566,10567)
+ PsiTypeQLElement(type) - Location: (10567,10578)(10567,10578)
+ PsiTypeQLElement(label) - Location: (10567,10578)(10567,10578)
+ PsiElement(LABEL_)('remediating')(10567,10578)
+ PsiWhiteSpace(' ')(10578,10579)
+ PsiElement('as')('as')(10579,10581)
+ PsiWhiteSpace(' ')(10581,10582)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10582,10588)(10582,10588)
+ PsiTypeQLElement(label) - Location: (10582,10588)(10582,10588)
+ PsiElement(LABEL_)('source')(10582,10588)
+ PsiElement(',')(',')(10588,10589)
+ PsiWhiteSpace('\n ')(10589,10594)
+ PsiTypeQLRelatesType(type_constraint) - Name: remediated - Location: (10594,10612)(10594,10622)
+ PsiElement('relates')('relates')(10594,10601)
+ PsiWhiteSpace(' ')(10601,10602)
+ PsiTypeQLElement(type) - Location: (10602,10612)(10602,10612)
+ PsiTypeQLElement(label) - Location: (10602,10612)(10602,10612)
+ PsiElement(LABEL_)('remediated')(10602,10612)
+ PsiWhiteSpace(' ')(10612,10613)
+ PsiElement('as')('as')(10613,10615)
+ PsiWhiteSpace(' ')(10615,10616)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10616,10622)(10616,10622)
+ PsiTypeQLElement(label) - Location: (10616,10622)(10616,10622)
+ PsiElement(LABEL_)('target')(10616,10622)
+ PsiElement(';')(';')(10622,10623)
+ PsiWhiteSpace('\n\n')(10623,10625)
+ PsiTypeQLElement(definable) - Location: (10625,10725)(10625,10725)
+ PsiTypeQLStatementType(statement_type) - Location: (10625,10725)(10625,10725)
+ PsiTypeQLElement(type_any) - Location: (10625,10635)(10625,10635)
+ PsiTypeQLType(type) - Name: located-at - Location: (10625,10635)(10625,10635)
+ PsiTypeQLElement(label) - Location: (10625,10635)(10625,10635)
+ PsiElement(LABEL_)('located-at')(10625,10635)
+ PsiWhiteSpace(' ')(10635,10636)
+ PsiTypeQLSubType(type_constraint) - Location: (10636,10662)(10636,10662)
+ PsiElement(SUB_)('sub')(10636,10639)
+ PsiWhiteSpace(' ')(10639,10640)
+ PsiTypeQLElement(type_any) - Location: (10640,10662)(10640,10662)
+ PsiTypeQLElement(type) - Location: (10640,10662)(10640,10662)
+ PsiTypeQLElement(label) - Location: (10640,10662)(10640,10662)
+ PsiElement(LABEL_)('stix-core-relationship')(10640,10662)
+ PsiElement(',')(',')(10662,10663)
+ PsiWhiteSpace('\n ')(10663,10668)
+ PsiTypeQLRelatesType(type_constraint) - Name: locating - Location: (10668,10684)(10668,10694)
+ PsiElement('relates')('relates')(10668,10675)
+ PsiWhiteSpace(' ')(10675,10676)
+ PsiTypeQLElement(type) - Location: (10676,10684)(10676,10684)
+ PsiTypeQLElement(label) - Location: (10676,10684)(10676,10684)
+ PsiElement(LABEL_)('locating')(10676,10684)
+ PsiWhiteSpace(' ')(10684,10685)
+ PsiElement('as')('as')(10685,10687)
+ PsiWhiteSpace(' ')(10687,10688)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10688,10694)(10688,10694)
+ PsiTypeQLElement(label) - Location: (10688,10694)(10688,10694)
+ PsiElement(LABEL_)('source')(10688,10694)
+ PsiElement(',')(',')(10694,10695)
+ PsiWhiteSpace('\n ')(10695,10700)
+ PsiTypeQLRelatesType(type_constraint) - Name: located - Location: (10700,10715)(10700,10725)
+ PsiElement('relates')('relates')(10700,10707)
+ PsiWhiteSpace(' ')(10707,10708)
+ PsiTypeQLElement(type) - Location: (10708,10715)(10708,10715)
+ PsiTypeQLElement(label) - Location: (10708,10715)(10708,10715)
+ PsiElement(LABEL_)('located')(10708,10715)
+ PsiWhiteSpace(' ')(10715,10716)
+ PsiElement('as')('as')(10716,10718)
+ PsiWhiteSpace(' ')(10718,10719)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10719,10725)(10719,10725)
+ PsiTypeQLElement(label) - Location: (10719,10725)(10719,10725)
+ PsiElement(LABEL_)('target')(10719,10725)
+ PsiElement(';')(';')(10725,10726)
+ PsiWhiteSpace('\n\n')(10726,10728)
+ PsiTypeQLElement(definable) - Location: (10728,10840)(10728,10840)
+ PsiTypeQLStatementType(statement_type) - Location: (10728,10840)(10728,10840)
+ PsiTypeQLElement(type_any) - Location: (10728,10740)(10728,10740)
+ PsiTypeQLType(type) - Name: impersonates - Location: (10728,10740)(10728,10740)
+ PsiTypeQLElement(label) - Location: (10728,10740)(10728,10740)
+ PsiElement(LABEL_)('impersonates')(10728,10740)
+ PsiWhiteSpace(' ')(10740,10741)
+ PsiTypeQLSubType(type_constraint) - Location: (10741,10767)(10741,10767)
+ PsiElement(SUB_)('sub')(10741,10744)
+ PsiWhiteSpace(' ')(10744,10745)
+ PsiTypeQLElement(type_any) - Location: (10745,10767)(10745,10767)
+ PsiTypeQLElement(type) - Location: (10745,10767)(10745,10767)
+ PsiTypeQLElement(label) - Location: (10745,10767)(10745,10767)
+ PsiElement(LABEL_)('stix-core-relationship')(10745,10767)
+ PsiElement(',')(',')(10767,10768)
+ PsiWhiteSpace('\n ')(10768,10773)
+ PsiTypeQLRelatesType(type_constraint) - Name: impersonating - Location: (10773,10794)(10773,10804)
+ PsiElement('relates')('relates')(10773,10780)
+ PsiWhiteSpace(' ')(10780,10781)
+ PsiTypeQLElement(type) - Location: (10781,10794)(10781,10794)
+ PsiTypeQLElement(label) - Location: (10781,10794)(10781,10794)
+ PsiElement(LABEL_)('impersonating')(10781,10794)
+ PsiWhiteSpace(' ')(10794,10795)
+ PsiElement('as')('as')(10795,10797)
+ PsiWhiteSpace(' ')(10797,10798)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10798,10804)(10798,10804)
+ PsiTypeQLElement(label) - Location: (10798,10804)(10798,10804)
+ PsiElement(LABEL_)('source')(10798,10804)
+ PsiElement(',')(',')(10804,10805)
+ PsiWhiteSpace('\n ')(10805,10810)
+ PsiTypeQLRelatesType(type_constraint) - Name: impersonated - Location: (10810,10830)(10810,10840)
+ PsiElement('relates')('relates')(10810,10817)
+ PsiWhiteSpace(' ')(10817,10818)
+ PsiTypeQLElement(type) - Location: (10818,10830)(10818,10830)
+ PsiTypeQLElement(label) - Location: (10818,10830)(10818,10830)
+ PsiElement(LABEL_)('impersonated')(10818,10830)
+ PsiWhiteSpace(' ')(10830,10831)
+ PsiElement('as')('as')(10831,10833)
+ PsiWhiteSpace(' ')(10833,10834)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10834,10840)(10834,10840)
+ PsiTypeQLElement(label) - Location: (10834,10840)(10834,10840)
+ PsiElement(LABEL_)('target')(10834,10840)
+ PsiElement(';')(';')(10840,10841)
+ PsiWhiteSpace('\n\n')(10841,10843)
+ PsiTypeQLElement(definable) - Location: (10843,10937)(10843,10937)
+ PsiTypeQLStatementType(statement_type) - Location: (10843,10937)(10843,10937)
+ PsiTypeQLElement(type_any) - Location: (10843,10851)(10843,10851)
+ PsiTypeQLType(type) - Name: based-on - Location: (10843,10851)(10843,10851)
+ PsiTypeQLElement(label) - Location: (10843,10851)(10843,10851)
+ PsiElement(LABEL_)('based-on')(10843,10851)
+ PsiWhiteSpace(' ')(10851,10852)
+ PsiTypeQLSubType(type_constraint) - Location: (10852,10878)(10852,10878)
+ PsiElement(SUB_)('sub')(10852,10855)
+ PsiWhiteSpace(' ')(10855,10856)
+ PsiTypeQLElement(type_any) - Location: (10856,10878)(10856,10878)
+ PsiTypeQLElement(type) - Location: (10856,10878)(10856,10878)
+ PsiTypeQLElement(label) - Location: (10856,10878)(10856,10878)
+ PsiElement(LABEL_)('stix-core-relationship')(10856,10878)
+ PsiElement(',')(',')(10878,10879)
+ PsiWhiteSpace('\n ')(10879,10884)
+ PsiTypeQLRelatesType(type_constraint) - Name: basing - Location: (10884,10898)(10884,10908)
+ PsiElement('relates')('relates')(10884,10891)
+ PsiWhiteSpace(' ')(10891,10892)
+ PsiTypeQLElement(type) - Location: (10892,10898)(10892,10898)
+ PsiTypeQLElement(label) - Location: (10892,10898)(10892,10898)
+ PsiElement(LABEL_)('basing')(10892,10898)
+ PsiWhiteSpace(' ')(10898,10899)
+ PsiElement('as')('as')(10899,10901)
+ PsiWhiteSpace(' ')(10901,10902)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10902,10908)(10902,10908)
+ PsiTypeQLElement(label) - Location: (10902,10908)(10902,10908)
+ PsiElement(LABEL_)('source')(10902,10908)
+ PsiElement(',')(',')(10908,10909)
+ PsiWhiteSpace('\n ')(10909,10914)
+ PsiTypeQLRelatesType(type_constraint) - Name: based - Location: (10914,10927)(10914,10937)
+ PsiElement('relates')('relates')(10914,10921)
+ PsiWhiteSpace(' ')(10921,10922)
+ PsiTypeQLElement(type) - Location: (10922,10927)(10922,10927)
+ PsiTypeQLElement(label) - Location: (10922,10927)(10922,10927)
+ PsiElement(LABEL_)('based')(10922,10927)
+ PsiWhiteSpace(' ')(10927,10928)
+ PsiElement('as')('as')(10928,10930)
+ PsiWhiteSpace(' ')(10930,10931)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (10931,10937)(10931,10937)
+ PsiTypeQLElement(label) - Location: (10931,10937)(10931,10937)
+ PsiElement(LABEL_)('target')(10931,10937)
+ PsiElement(';')(';')(10937,10938)
+ PsiWhiteSpace('\n\n')(10938,10940)
+ PsiTypeQLElement(definable) - Location: (10940,11057)(10940,11057)
+ PsiTypeQLStatementType(statement_type) - Location: (10940,11057)(10940,11057)
+ PsiTypeQLElement(type_any) - Location: (10940,10957)(10940,10957)
+ PsiTypeQLType(type) - Name: communicates-with - Location: (10940,10957)(10940,10957)
+ PsiTypeQLElement(label) - Location: (10940,10957)(10940,10957)
+ PsiElement(LABEL_)('communicates-with')(10940,10957)
+ PsiWhiteSpace(' ')(10957,10958)
+ PsiTypeQLSubType(type_constraint) - Location: (10958,10984)(10958,10984)
+ PsiElement(SUB_)('sub')(10958,10961)
+ PsiWhiteSpace(' ')(10961,10962)
+ PsiTypeQLElement(type_any) - Location: (10962,10984)(10962,10984)
+ PsiTypeQLElement(type) - Location: (10962,10984)(10962,10984)
+ PsiTypeQLElement(label) - Location: (10962,10984)(10962,10984)
+ PsiElement(LABEL_)('stix-core-relationship')(10962,10984)
+ PsiElement(',')(',')(10984,10985)
+ PsiWhiteSpace('\n ')(10985,10990)
+ PsiTypeQLRelatesType(type_constraint) - Name: communicating - Location: (10990,11011)(10990,11021)
+ PsiElement('relates')('relates')(10990,10997)
+ PsiWhiteSpace(' ')(10997,10998)
+ PsiTypeQLElement(type) - Location: (10998,11011)(10998,11011)
+ PsiTypeQLElement(label) - Location: (10998,11011)(10998,11011)
+ PsiElement(LABEL_)('communicating')(10998,11011)
+ PsiWhiteSpace(' ')(11011,11012)
+ PsiElement('as')('as')(11012,11014)
+ PsiWhiteSpace(' ')(11014,11015)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11015,11021)(11015,11021)
+ PsiTypeQLElement(label) - Location: (11015,11021)(11015,11021)
+ PsiElement(LABEL_)('source')(11015,11021)
+ PsiElement(',')(',')(11021,11022)
+ PsiWhiteSpace('\n ')(11022,11027)
+ PsiTypeQLRelatesType(type_constraint) - Name: communicated - Location: (11027,11047)(11027,11057)
+ PsiElement('relates')('relates')(11027,11034)
+ PsiWhiteSpace(' ')(11034,11035)
+ PsiTypeQLElement(type) - Location: (11035,11047)(11035,11047)
+ PsiTypeQLElement(label) - Location: (11035,11047)(11035,11047)
+ PsiElement(LABEL_)('communicated')(11035,11047)
+ PsiWhiteSpace(' ')(11047,11048)
+ PsiElement('as')('as')(11048,11050)
+ PsiWhiteSpace(' ')(11050,11051)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11051,11057)(11051,11057)
+ PsiTypeQLElement(label) - Location: (11051,11057)(11051,11057)
+ PsiElement(LABEL_)('target')(11051,11057)
+ PsiElement(';')(';')(11057,11058)
+ PsiWhiteSpace('\n\n')(11058,11060)
+ PsiTypeQLElement(definable) - Location: (11060,11164)(11060,11164)
+ PsiTypeQLStatementType(statement_type) - Location: (11060,11164)(11060,11164)
+ PsiTypeQLElement(type_any) - Location: (11060,11070)(11060,11070)
+ PsiTypeQLType(type) - Name: consist-of - Location: (11060,11070)(11060,11070)
+ PsiTypeQLElement(label) - Location: (11060,11070)(11060,11070)
+ PsiElement(LABEL_)('consist-of')(11060,11070)
+ PsiWhiteSpace(' ')(11070,11071)
+ PsiTypeQLSubType(type_constraint) - Location: (11071,11097)(11071,11097)
+ PsiElement(SUB_)('sub')(11071,11074)
+ PsiWhiteSpace(' ')(11074,11075)
+ PsiTypeQLElement(type_any) - Location: (11075,11097)(11075,11097)
+ PsiTypeQLElement(type) - Location: (11075,11097)(11075,11097)
+ PsiTypeQLElement(label) - Location: (11075,11097)(11075,11097)
+ PsiElement(LABEL_)('stix-core-relationship')(11075,11097)
+ PsiElement(',')(',')(11097,11098)
+ PsiWhiteSpace('\n ')(11098,11103)
+ PsiTypeQLRelatesType(type_constraint) - Name: consisting - Location: (11103,11121)(11103,11131)
+ PsiElement('relates')('relates')(11103,11110)
+ PsiWhiteSpace(' ')(11110,11111)
+ PsiTypeQLElement(type) - Location: (11111,11121)(11111,11121)
+ PsiTypeQLElement(label) - Location: (11111,11121)(11111,11121)
+ PsiElement(LABEL_)('consisting')(11111,11121)
+ PsiWhiteSpace(' ')(11121,11122)
+ PsiElement('as')('as')(11122,11124)
+ PsiWhiteSpace(' ')(11124,11125)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11125,11131)(11125,11131)
+ PsiTypeQLElement(label) - Location: (11125,11131)(11125,11131)
+ PsiElement(LABEL_)('source')(11125,11131)
+ PsiElement(',')(',')(11131,11132)
+ PsiWhiteSpace('\n ')(11132,11137)
+ PsiTypeQLRelatesType(type_constraint) - Name: consisted - Location: (11137,11154)(11137,11164)
+ PsiElement('relates')('relates')(11137,11144)
+ PsiWhiteSpace(' ')(11144,11145)
+ PsiTypeQLElement(type) - Location: (11145,11154)(11145,11154)
+ PsiTypeQLElement(label) - Location: (11145,11154)(11145,11154)
+ PsiElement(LABEL_)('consisted')(11145,11154)
+ PsiWhiteSpace(' ')(11154,11155)
+ PsiElement('as')('as')(11155,11157)
+ PsiWhiteSpace(' ')(11157,11158)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11158,11164)(11158,11164)
+ PsiTypeQLElement(label) - Location: (11158,11164)(11158,11164)
+ PsiElement(LABEL_)('target')(11158,11164)
+ PsiElement(';')(';')(11164,11165)
+ PsiWhiteSpace('\n\n')(11165,11167)
+ PsiTypeQLElement(definable) - Location: (11167,11271)(11167,11271)
+ PsiTypeQLStatementType(statement_type) - Location: (11167,11271)(11167,11271)
+ PsiTypeQLElement(type_any) - Location: (11167,11175)(11167,11175)
+ PsiTypeQLType(type) - Name: controls - Location: (11167,11175)(11167,11175)
+ PsiTypeQLElement(label) - Location: (11167,11175)(11167,11175)
+ PsiElement(LABEL_)('controls')(11167,11175)
+ PsiWhiteSpace(' ')(11175,11176)
+ PsiTypeQLSubType(type_constraint) - Location: (11176,11202)(11176,11202)
+ PsiElement(SUB_)('sub')(11176,11179)
+ PsiWhiteSpace(' ')(11179,11180)
+ PsiTypeQLElement(type_any) - Location: (11180,11202)(11180,11202)
+ PsiTypeQLElement(type) - Location: (11180,11202)(11180,11202)
+ PsiTypeQLElement(label) - Location: (11180,11202)(11180,11202)
+ PsiElement(LABEL_)('stix-core-relationship')(11180,11202)
+ PsiElement(',')(',')(11202,11203)
+ PsiWhiteSpace('\n ')(11203,11208)
+ PsiTypeQLRelatesType(type_constraint) - Name: controlling - Location: (11208,11227)(11208,11237)
+ PsiElement('relates')('relates')(11208,11215)
+ PsiWhiteSpace(' ')(11215,11216)
+ PsiTypeQLElement(type) - Location: (11216,11227)(11216,11227)
+ PsiTypeQLElement(label) - Location: (11216,11227)(11216,11227)
+ PsiElement(LABEL_)('controlling')(11216,11227)
+ PsiWhiteSpace(' ')(11227,11228)
+ PsiElement('as')('as')(11228,11230)
+ PsiWhiteSpace(' ')(11230,11231)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11231,11237)(11231,11237)
+ PsiTypeQLElement(label) - Location: (11231,11237)(11231,11237)
+ PsiElement(LABEL_)('source')(11231,11237)
+ PsiElement(',')(',')(11237,11238)
+ PsiWhiteSpace('\n ')(11238,11243)
+ PsiTypeQLRelatesType(type_constraint) - Name: controlled - Location: (11243,11261)(11243,11271)
+ PsiElement('relates')('relates')(11243,11250)
+ PsiWhiteSpace(' ')(11250,11251)
+ PsiTypeQLElement(type) - Location: (11251,11261)(11251,11261)
+ PsiTypeQLElement(label) - Location: (11251,11261)(11251,11261)
+ PsiElement(LABEL_)('controlled')(11251,11261)
+ PsiWhiteSpace(' ')(11261,11262)
+ PsiElement('as')('as')(11262,11264)
+ PsiWhiteSpace(' ')(11264,11265)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11265,11271)(11265,11271)
+ PsiTypeQLElement(label) - Location: (11265,11271)(11265,11271)
+ PsiElement(LABEL_)('target')(11265,11271)
+ PsiElement(';')(';')(11271,11272)
+ PsiWhiteSpace('\n\n')(11272,11274)
+ PsiTypeQLElement(definable) - Location: (11274,11362)(11274,11362)
+ PsiTypeQLStatementType(statement_type) - Location: (11274,11362)(11274,11362)
+ PsiTypeQLElement(type_any) - Location: (11274,11278)(11274,11278)
+ PsiTypeQLType(type) - Name: have - Location: (11274,11278)(11274,11278)
+ PsiTypeQLElement(label) - Location: (11274,11278)(11274,11278)
+ PsiElement(LABEL_)('have')(11274,11278)
+ PsiWhiteSpace(' ')(11278,11279)
+ PsiTypeQLSubType(type_constraint) - Location: (11279,11305)(11279,11305)
+ PsiElement(SUB_)('sub')(11279,11282)
+ PsiWhiteSpace(' ')(11282,11283)
+ PsiTypeQLElement(type_any) - Location: (11283,11305)(11283,11305)
+ PsiTypeQLElement(type) - Location: (11283,11305)(11283,11305)
+ PsiTypeQLElement(label) - Location: (11283,11305)(11283,11305)
+ PsiElement(LABEL_)('stix-core-relationship')(11283,11305)
+ PsiElement(',')(',')(11305,11306)
+ PsiWhiteSpace('\n ')(11306,11311)
+ PsiTypeQLRelatesType(type_constraint) - Name: having - Location: (11311,11325)(11311,11335)
+ PsiElement('relates')('relates')(11311,11318)
+ PsiWhiteSpace(' ')(11318,11319)
+ PsiTypeQLElement(type) - Location: (11319,11325)(11319,11325)
+ PsiTypeQLElement(label) - Location: (11319,11325)(11319,11325)
+ PsiElement(LABEL_)('having')(11319,11325)
+ PsiWhiteSpace(' ')(11325,11326)
+ PsiElement('as')('as')(11326,11328)
+ PsiWhiteSpace(' ')(11328,11329)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11329,11335)(11329,11335)
+ PsiTypeQLElement(label) - Location: (11329,11335)(11329,11335)
+ PsiElement(LABEL_)('source')(11329,11335)
+ PsiElement(',')(',')(11335,11336)
+ PsiWhiteSpace('\n ')(11336,11341)
+ PsiTypeQLRelatesType(type_constraint) - Name: had - Location: (11341,11352)(11341,11362)
+ PsiElement('relates')('relates')(11341,11348)
+ PsiWhiteSpace(' ')(11348,11349)
+ PsiTypeQLElement(type) - Location: (11349,11352)(11349,11352)
+ PsiTypeQLElement(label) - Location: (11349,11352)(11349,11352)
+ PsiElement(LABEL_)('had')(11349,11352)
+ PsiWhiteSpace(' ')(11352,11353)
+ PsiElement('as')('as')(11353,11355)
+ PsiWhiteSpace(' ')(11355,11356)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11356,11362)(11356,11362)
+ PsiTypeQLElement(label) - Location: (11356,11362)(11356,11362)
+ PsiElement(LABEL_)('target')(11356,11362)
+ PsiElement(';')(';')(11362,11363)
+ PsiWhiteSpace('\n\n')(11363,11365)
+ PsiTypeQLElement(definable) - Location: (11365,11458)(11365,11458)
+ PsiTypeQLStatementType(statement_type) - Location: (11365,11458)(11365,11458)
+ PsiTypeQLElement(type_any) - Location: (11365,11370)(11365,11370)
+ PsiTypeQLType(type) - Name: hosts - Location: (11365,11370)(11365,11370)
+ PsiTypeQLElement(label) - Location: (11365,11370)(11365,11370)
+ PsiElement(LABEL_)('hosts')(11365,11370)
+ PsiWhiteSpace(' ')(11370,11371)
+ PsiTypeQLSubType(type_constraint) - Location: (11371,11397)(11371,11397)
+ PsiElement(SUB_)('sub')(11371,11374)
+ PsiWhiteSpace(' ')(11374,11375)
+ PsiTypeQLElement(type_any) - Location: (11375,11397)(11375,11397)
+ PsiTypeQLElement(type) - Location: (11375,11397)(11375,11397)
+ PsiTypeQLElement(label) - Location: (11375,11397)(11375,11397)
+ PsiElement(LABEL_)('stix-core-relationship')(11375,11397)
+ PsiElement(',')(',')(11397,11398)
+ PsiWhiteSpace('\n ')(11398,11403)
+ PsiTypeQLRelatesType(type_constraint) - Name: hosting - Location: (11403,11418)(11403,11428)
+ PsiElement('relates')('relates')(11403,11410)
+ PsiWhiteSpace(' ')(11410,11411)
+ PsiTypeQLElement(type) - Location: (11411,11418)(11411,11418)
+ PsiTypeQLElement(label) - Location: (11411,11418)(11411,11418)
+ PsiElement(LABEL_)('hosting')(11411,11418)
+ PsiWhiteSpace(' ')(11418,11419)
+ PsiElement('as')('as')(11419,11421)
+ PsiWhiteSpace(' ')(11421,11422)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11422,11428)(11422,11428)
+ PsiTypeQLElement(label) - Location: (11422,11428)(11422,11428)
+ PsiElement(LABEL_)('source')(11422,11428)
+ PsiElement(',')(',')(11428,11429)
+ PsiWhiteSpace('\n ')(11429,11434)
+ PsiTypeQLRelatesType(type_constraint) - Name: hosted - Location: (11434,11448)(11434,11458)
+ PsiElement('relates')('relates')(11434,11441)
+ PsiWhiteSpace(' ')(11441,11442)
+ PsiTypeQLElement(type) - Location: (11442,11448)(11442,11448)
+ PsiTypeQLElement(label) - Location: (11442,11448)(11442,11448)
+ PsiElement(LABEL_)('hosted')(11442,11448)
+ PsiWhiteSpace(' ')(11448,11449)
+ PsiElement('as')('as')(11449,11451)
+ PsiWhiteSpace(' ')(11451,11452)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11452,11458)(11452,11458)
+ PsiTypeQLElement(label) - Location: (11452,11458)(11452,11458)
+ PsiElement(LABEL_)('target')(11452,11458)
+ PsiElement(';')(';')(11458,11459)
+ PsiWhiteSpace('\n\n')(11459,11461)
+ PsiTypeQLElement(definable) - Location: (11461,11564)(11461,11564)
+ PsiTypeQLStatementType(statement_type) - Location: (11461,11564)(11461,11564)
+ PsiTypeQLElement(type_any) - Location: (11461,11472)(11461,11472)
+ PsiTypeQLType(type) - Name: authored-by - Location: (11461,11472)(11461,11472)
+ PsiTypeQLElement(label) - Location: (11461,11472)(11461,11472)
+ PsiElement(LABEL_)('authored-by')(11461,11472)
+ PsiWhiteSpace(' ')(11472,11473)
+ PsiTypeQLSubType(type_constraint) - Location: (11473,11499)(11473,11499)
+ PsiElement(SUB_)('sub')(11473,11476)
+ PsiWhiteSpace(' ')(11476,11477)
+ PsiTypeQLElement(type_any) - Location: (11477,11499)(11477,11499)
+ PsiTypeQLElement(type) - Location: (11477,11499)(11477,11499)
+ PsiTypeQLElement(label) - Location: (11477,11499)(11477,11499)
+ PsiElement(LABEL_)('stix-core-relationship')(11477,11499)
+ PsiElement(',')(',')(11499,11500)
+ PsiWhiteSpace('\n ')(11500,11505)
+ PsiTypeQLRelatesType(type_constraint) - Name: authoring - Location: (11505,11522)(11505,11532)
+ PsiElement('relates')('relates')(11505,11512)
+ PsiWhiteSpace(' ')(11512,11513)
+ PsiTypeQLElement(type) - Location: (11513,11522)(11513,11522)
+ PsiTypeQLElement(label) - Location: (11513,11522)(11513,11522)
+ PsiElement(LABEL_)('authoring')(11513,11522)
+ PsiWhiteSpace(' ')(11522,11523)
+ PsiElement('as')('as')(11523,11525)
+ PsiWhiteSpace(' ')(11525,11526)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11526,11532)(11526,11532)
+ PsiTypeQLElement(label) - Location: (11526,11532)(11526,11532)
+ PsiElement(LABEL_)('source')(11526,11532)
+ PsiElement(',')(',')(11532,11533)
+ PsiWhiteSpace('\n ')(11533,11538)
+ PsiTypeQLRelatesType(type_constraint) - Name: authored - Location: (11538,11554)(11538,11564)
+ PsiElement('relates')('relates')(11538,11545)
+ PsiWhiteSpace(' ')(11545,11546)
+ PsiTypeQLElement(type) - Location: (11546,11554)(11546,11554)
+ PsiTypeQLElement(label) - Location: (11546,11554)(11546,11554)
+ PsiElement(LABEL_)('authored')(11546,11554)
+ PsiWhiteSpace(' ')(11554,11555)
+ PsiElement('as')('as')(11555,11557)
+ PsiWhiteSpace(' ')(11557,11558)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11558,11564)(11558,11564)
+ PsiTypeQLElement(label) - Location: (11558,11564)(11558,11564)
+ PsiElement(LABEL_)('target')(11558,11564)
+ PsiElement(';')(';')(11564,11565)
+ PsiWhiteSpace('\n\n')(11565,11567)
+ PsiTypeQLElement(definable) - Location: (11567,11675)(11567,11675)
+ PsiTypeQLStatementType(statement_type) - Location: (11567,11675)(11567,11675)
+ PsiTypeQLElement(type_any) - Location: (11567,11577)(11567,11577)
+ PsiTypeQLType(type) - Name: beacons-to - Location: (11567,11577)(11567,11577)
+ PsiTypeQLElement(label) - Location: (11567,11577)(11567,11577)
+ PsiElement(LABEL_)('beacons-to')(11567,11577)
+ PsiWhiteSpace(' ')(11577,11578)
+ PsiTypeQLSubType(type_constraint) - Location: (11578,11604)(11578,11604)
+ PsiElement(SUB_)('sub')(11578,11581)
+ PsiWhiteSpace(' ')(11581,11582)
+ PsiTypeQLElement(type_any) - Location: (11582,11604)(11582,11604)
+ PsiTypeQLElement(type) - Location: (11582,11604)(11582,11604)
+ PsiTypeQLElement(label) - Location: (11582,11604)(11582,11604)
+ PsiElement(LABEL_)('stix-core-relationship')(11582,11604)
+ PsiElement(',')(',')(11604,11605)
+ PsiWhiteSpace('\n ')(11605,11610)
+ PsiTypeQLRelatesType(type_constraint) - Name: beaconing-to - Location: (11610,11630)(11610,11640)
+ PsiElement('relates')('relates')(11610,11617)
+ PsiWhiteSpace(' ')(11617,11618)
+ PsiTypeQLElement(type) - Location: (11618,11630)(11618,11630)
+ PsiTypeQLElement(label) - Location: (11618,11630)(11618,11630)
+ PsiElement(LABEL_)('beaconing-to')(11618,11630)
+ PsiWhiteSpace(' ')(11630,11631)
+ PsiElement('as')('as')(11631,11633)
+ PsiWhiteSpace(' ')(11633,11634)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11634,11640)(11634,11640)
+ PsiTypeQLElement(label) - Location: (11634,11640)(11634,11640)
+ PsiElement(LABEL_)('source')(11634,11640)
+ PsiElement(',')(',')(11640,11641)
+ PsiWhiteSpace('\n ')(11641,11646)
+ PsiTypeQLRelatesType(type_constraint) - Name: beaconed-to - Location: (11646,11665)(11646,11675)
+ PsiElement('relates')('relates')(11646,11653)
+ PsiWhiteSpace(' ')(11653,11654)
+ PsiTypeQLElement(type) - Location: (11654,11665)(11654,11665)
+ PsiTypeQLElement(label) - Location: (11654,11665)(11654,11665)
+ PsiElement(LABEL_)('beaconed-to')(11654,11665)
+ PsiWhiteSpace(' ')(11665,11666)
+ PsiElement('as')('as')(11666,11668)
+ PsiWhiteSpace(' ')(11668,11669)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11669,11675)(11669,11675)
+ PsiTypeQLElement(label) - Location: (11669,11675)(11669,11675)
+ PsiElement(LABEL_)('target')(11669,11675)
+ PsiElement(';')(';')(11675,11676)
+ PsiWhiteSpace('\n\n')(11676,11678)
+ PsiTypeQLElement(definable) - Location: (11678,11796)(11678,11796)
+ PsiTypeQLStatementType(statement_type) - Location: (11678,11796)(11678,11796)
+ PsiTypeQLElement(type_any) - Location: (11678,11692)(11678,11692)
+ PsiTypeQLType(type) - Name: exfiltrates-to - Location: (11678,11692)(11678,11692)
+ PsiTypeQLElement(label) - Location: (11678,11692)(11678,11692)
+ PsiElement(LABEL_)('exfiltrates-to')(11678,11692)
+ PsiWhiteSpace(' ')(11692,11693)
+ PsiTypeQLSubType(type_constraint) - Location: (11693,11719)(11693,11719)
+ PsiElement(SUB_)('sub')(11693,11696)
+ PsiWhiteSpace(' ')(11696,11697)
+ PsiTypeQLElement(type_any) - Location: (11697,11719)(11697,11719)
+ PsiTypeQLElement(type) - Location: (11697,11719)(11697,11719)
+ PsiTypeQLElement(label) - Location: (11697,11719)(11697,11719)
+ PsiElement(LABEL_)('stix-core-relationship')(11697,11719)
+ PsiElement(',')(',')(11719,11720)
+ PsiWhiteSpace('\n ')(11720,11725)
+ PsiTypeQLRelatesType(type_constraint) - Name: exfiltrating-to - Location: (11725,11748)(11725,11758)
+ PsiElement('relates')('relates')(11725,11732)
+ PsiWhiteSpace(' ')(11732,11733)
+ PsiTypeQLElement(type) - Location: (11733,11748)(11733,11748)
+ PsiTypeQLElement(label) - Location: (11733,11748)(11733,11748)
+ PsiElement(LABEL_)('exfiltrating-to')(11733,11748)
+ PsiWhiteSpace(' ')(11748,11749)
+ PsiElement('as')('as')(11749,11751)
+ PsiWhiteSpace(' ')(11751,11752)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11752,11758)(11752,11758)
+ PsiTypeQLElement(label) - Location: (11752,11758)(11752,11758)
+ PsiElement(LABEL_)('source')(11752,11758)
+ PsiElement(',')(',')(11758,11759)
+ PsiWhiteSpace('\n ')(11759,11764)
+ PsiTypeQLRelatesType(type_constraint) - Name: exfiltrated-to - Location: (11764,11786)(11764,11796)
+ PsiElement('relates')('relates')(11764,11771)
+ PsiWhiteSpace(' ')(11771,11772)
+ PsiTypeQLElement(type) - Location: (11772,11786)(11772,11786)
+ PsiTypeQLElement(label) - Location: (11772,11786)(11772,11786)
+ PsiElement(LABEL_)('exfiltrated-to')(11772,11786)
+ PsiWhiteSpace(' ')(11786,11787)
+ PsiElement('as')('as')(11787,11789)
+ PsiWhiteSpace(' ')(11789,11790)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11790,11796)(11790,11796)
+ PsiTypeQLElement(label) - Location: (11790,11796)(11790,11796)
+ PsiElement(LABEL_)('target')(11790,11796)
+ PsiElement(';')(';')(11796,11797)
+ PsiWhiteSpace('\n\n')(11797,11799)
+ PsiTypeQLElement(definable) - Location: (11799,11904)(11799,11904)
+ PsiTypeQLStatementType(statement_type) - Location: (11799,11904)(11799,11904)
+ PsiTypeQLElement(type_any) - Location: (11799,11808)(11799,11808)
+ PsiTypeQLType(type) - Name: downloads - Location: (11799,11808)(11799,11808)
+ PsiTypeQLElement(label) - Location: (11799,11808)(11799,11808)
+ PsiElement(LABEL_)('downloads')(11799,11808)
+ PsiWhiteSpace(' ')(11808,11809)
+ PsiTypeQLSubType(type_constraint) - Location: (11809,11835)(11809,11835)
+ PsiElement(SUB_)('sub')(11809,11812)
+ PsiWhiteSpace(' ')(11812,11813)
+ PsiTypeQLElement(type_any) - Location: (11813,11835)(11813,11835)
+ PsiTypeQLElement(type) - Location: (11813,11835)(11813,11835)
+ PsiTypeQLElement(label) - Location: (11813,11835)(11813,11835)
+ PsiElement(LABEL_)('stix-core-relationship')(11813,11835)
+ PsiElement(',')(',')(11835,11836)
+ PsiWhiteSpace('\n ')(11836,11841)
+ PsiTypeQLRelatesType(type_constraint) - Name: downloading - Location: (11841,11860)(11841,11870)
+ PsiElement('relates')('relates')(11841,11848)
+ PsiWhiteSpace(' ')(11848,11849)
+ PsiTypeQLElement(type) - Location: (11849,11860)(11849,11860)
+ PsiTypeQLElement(label) - Location: (11849,11860)(11849,11860)
+ PsiElement(LABEL_)('downloading')(11849,11860)
+ PsiWhiteSpace(' ')(11860,11861)
+ PsiElement('as')('as')(11861,11863)
+ PsiWhiteSpace(' ')(11863,11864)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11864,11870)(11864,11870)
+ PsiTypeQLElement(label) - Location: (11864,11870)(11864,11870)
+ PsiElement(LABEL_)('source')(11864,11870)
+ PsiElement(',')(',')(11870,11871)
+ PsiWhiteSpace('\n ')(11871,11876)
+ PsiTypeQLRelatesType(type_constraint) - Name: downloaded - Location: (11876,11894)(11876,11904)
+ PsiElement('relates')('relates')(11876,11883)
+ PsiWhiteSpace(' ')(11883,11884)
+ PsiTypeQLElement(type) - Location: (11884,11894)(11884,11894)
+ PsiTypeQLElement(label) - Location: (11884,11894)(11884,11894)
+ PsiElement(LABEL_)('downloaded')(11884,11894)
+ PsiWhiteSpace(' ')(11894,11895)
+ PsiElement('as')('as')(11895,11897)
+ PsiWhiteSpace(' ')(11897,11898)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11898,11904)(11898,11904)
+ PsiTypeQLElement(label) - Location: (11898,11904)(11898,11904)
+ PsiElement(LABEL_)('target')(11898,11904)
+ PsiElement(';')(';')(11904,11905)
+ PsiWhiteSpace('\n\n')(11905,11907)
+ PsiTypeQLElement(definable) - Location: (11907,12002)(11907,12002)
+ PsiTypeQLStatementType(statement_type) - Location: (11907,12002)(11907,12002)
+ PsiTypeQLElement(type_any) - Location: (11907,11912)(11907,11912)
+ PsiTypeQLType(type) - Name: drops - Location: (11907,11912)(11907,11912)
+ PsiTypeQLElement(label) - Location: (11907,11912)(11907,11912)
+ PsiElement(LABEL_)('drops')(11907,11912)
+ PsiWhiteSpace(' ')(11912,11913)
+ PsiTypeQLSubType(type_constraint) - Location: (11913,11939)(11913,11939)
+ PsiElement(SUB_)('sub')(11913,11916)
+ PsiWhiteSpace(' ')(11916,11917)
+ PsiTypeQLElement(type_any) - Location: (11917,11939)(11917,11939)
+ PsiTypeQLElement(type) - Location: (11917,11939)(11917,11939)
+ PsiTypeQLElement(label) - Location: (11917,11939)(11917,11939)
+ PsiElement(LABEL_)('stix-core-relationship')(11917,11939)
+ PsiElement(',')(',')(11939,11940)
+ PsiWhiteSpace('\n ')(11940,11945)
+ PsiTypeQLRelatesType(type_constraint) - Name: dropping - Location: (11945,11961)(11945,11971)
+ PsiElement('relates')('relates')(11945,11952)
+ PsiWhiteSpace(' ')(11952,11953)
+ PsiTypeQLElement(type) - Location: (11953,11961)(11953,11961)
+ PsiTypeQLElement(label) - Location: (11953,11961)(11953,11961)
+ PsiElement(LABEL_)('dropping')(11953,11961)
+ PsiWhiteSpace(' ')(11961,11962)
+ PsiElement('as')('as')(11962,11964)
+ PsiWhiteSpace(' ')(11964,11965)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11965,11971)(11965,11971)
+ PsiTypeQLElement(label) - Location: (11965,11971)(11965,11971)
+ PsiElement(LABEL_)('source')(11965,11971)
+ PsiElement(',')(',')(11971,11972)
+ PsiWhiteSpace('\n ')(11972,11977)
+ PsiTypeQLRelatesType(type_constraint) - Name: dropped - Location: (11977,11992)(11977,12002)
+ PsiElement('relates')('relates')(11977,11984)
+ PsiWhiteSpace(' ')(11984,11985)
+ PsiTypeQLElement(type) - Location: (11985,11992)(11985,11992)
+ PsiTypeQLElement(label) - Location: (11985,11992)(11985,11992)
+ PsiElement(LABEL_)('dropped')(11985,11992)
+ PsiWhiteSpace(' ')(11992,11993)
+ PsiElement('as')('as')(11993,11995)
+ PsiWhiteSpace(' ')(11995,11996)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (11996,12002)(11996,12002)
+ PsiTypeQLElement(label) - Location: (11996,12002)(11996,12002)
+ PsiElement(LABEL_)('target')(11996,12002)
+ PsiElement(';')(';')(12002,12003)
+ PsiWhiteSpace('\n\n')(12003,12005)
+ PsiTypeQLElement(definable) - Location: (12005,12107)(12005,12107)
+ PsiTypeQLStatementType(statement_type) - Location: (12005,12107)(12005,12107)
+ PsiTypeQLElement(type_any) - Location: (12005,12013)(12005,12013)
+ PsiTypeQLType(type) - Name: exploits - Location: (12005,12013)(12005,12013)
+ PsiTypeQLElement(label) - Location: (12005,12013)(12005,12013)
+ PsiElement(LABEL_)('exploits')(12005,12013)
+ PsiWhiteSpace(' ')(12013,12014)
+ PsiTypeQLSubType(type_constraint) - Location: (12014,12040)(12014,12040)
+ PsiElement(SUB_)('sub')(12014,12017)
+ PsiWhiteSpace(' ')(12017,12018)
+ PsiTypeQLElement(type_any) - Location: (12018,12040)(12018,12040)
+ PsiTypeQLElement(type) - Location: (12018,12040)(12018,12040)
+ PsiTypeQLElement(label) - Location: (12018,12040)(12018,12040)
+ PsiElement(LABEL_)('stix-core-relationship')(12018,12040)
+ PsiElement(',')(',')(12040,12041)
+ PsiWhiteSpace('\n ')(12041,12046)
+ PsiTypeQLRelatesType(type_constraint) - Name: exploiting - Location: (12046,12064)(12046,12074)
+ PsiElement('relates')('relates')(12046,12053)
+ PsiWhiteSpace(' ')(12053,12054)
+ PsiTypeQLElement(type) - Location: (12054,12064)(12054,12064)
+ PsiTypeQLElement(label) - Location: (12054,12064)(12054,12064)
+ PsiElement(LABEL_)('exploiting')(12054,12064)
+ PsiWhiteSpace(' ')(12064,12065)
+ PsiElement('as')('as')(12065,12067)
+ PsiWhiteSpace(' ')(12067,12068)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12068,12074)(12068,12074)
+ PsiTypeQLElement(label) - Location: (12068,12074)(12068,12074)
+ PsiElement(LABEL_)('source')(12068,12074)
+ PsiElement(',')(',')(12074,12075)
+ PsiWhiteSpace('\n ')(12075,12080)
+ PsiTypeQLRelatesType(type_constraint) - Name: exploited - Location: (12080,12097)(12080,12107)
+ PsiElement('relates')('relates')(12080,12087)
+ PsiWhiteSpace(' ')(12087,12088)
+ PsiTypeQLElement(type) - Location: (12088,12097)(12088,12097)
+ PsiTypeQLElement(label) - Location: (12088,12097)(12088,12097)
+ PsiElement(LABEL_)('exploited')(12088,12097)
+ PsiWhiteSpace(' ')(12097,12098)
+ PsiElement('as')('as')(12098,12100)
+ PsiWhiteSpace(' ')(12100,12101)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12101,12107)(12101,12107)
+ PsiTypeQLElement(label) - Location: (12101,12107)(12101,12107)
+ PsiElement(LABEL_)('target')(12101,12107)
+ PsiElement(';')(';')(12107,12108)
+ PsiWhiteSpace('\n\n')(12108,12110)
+ PsiTypeQLElement(definable) - Location: (12110,12218)(12110,12218)
+ PsiTypeQLStatementType(statement_type) - Location: (12110,12218)(12110,12218)
+ PsiTypeQLElement(type_any) - Location: (12110,12120)(12110,12120)
+ PsiTypeQLType(type) - Name: variant-of - Location: (12110,12120)(12110,12120)
+ PsiTypeQLElement(label) - Location: (12110,12120)(12110,12120)
+ PsiElement(LABEL_)('variant-of')(12110,12120)
+ PsiWhiteSpace(' ')(12120,12121)
+ PsiTypeQLSubType(type_constraint) - Location: (12121,12147)(12121,12147)
+ PsiElement(SUB_)('sub')(12121,12124)
+ PsiWhiteSpace(' ')(12124,12125)
+ PsiTypeQLElement(type_any) - Location: (12125,12147)(12125,12147)
+ PsiTypeQLElement(type) - Location: (12125,12147)(12125,12147)
+ PsiTypeQLElement(label) - Location: (12125,12147)(12125,12147)
+ PsiElement(LABEL_)('stix-core-relationship')(12125,12147)
+ PsiElement(',')(',')(12147,12148)
+ PsiWhiteSpace('\n ')(12148,12153)
+ PsiTypeQLRelatesType(type_constraint) - Name: varianted-from - Location: (12153,12175)(12153,12185)
+ PsiElement('relates')('relates')(12153,12160)
+ PsiWhiteSpace(' ')(12160,12161)
+ PsiTypeQLElement(type) - Location: (12161,12175)(12161,12175)
+ PsiTypeQLElement(label) - Location: (12161,12175)(12161,12175)
+ PsiElement(LABEL_)('varianted-from')(12161,12175)
+ PsiWhiteSpace(' ')(12175,12176)
+ PsiElement('as')('as')(12176,12178)
+ PsiWhiteSpace(' ')(12178,12179)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12179,12185)(12179,12185)
+ PsiTypeQLElement(label) - Location: (12179,12185)(12179,12185)
+ PsiElement(LABEL_)('source')(12179,12185)
+ PsiElement(',')(',')(12185,12186)
+ PsiWhiteSpace('\n ')(12186,12191)
+ PsiTypeQLRelatesType(type_constraint) - Name: varianted - Location: (12191,12208)(12191,12218)
+ PsiElement('relates')('relates')(12191,12198)
+ PsiWhiteSpace(' ')(12198,12199)
+ PsiTypeQLElement(type) - Location: (12199,12208)(12199,12208)
+ PsiTypeQLElement(label) - Location: (12199,12208)(12199,12208)
+ PsiElement(LABEL_)('varianted')(12199,12208)
+ PsiWhiteSpace(' ')(12208,12209)
+ PsiElement('as')('as')(12209,12211)
+ PsiWhiteSpace(' ')(12211,12212)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12212,12218)(12212,12218)
+ PsiTypeQLElement(label) - Location: (12212,12218)(12212,12218)
+ PsiElement(LABEL_)('target')(12212,12218)
+ PsiElement(';')(';')(12218,12219)
+ PsiWhiteSpace('\n\n')(12219,12221)
+ PsiTypeQLElement(definable) - Location: (12221,12336)(12221,12336)
+ PsiTypeQLStatementType(statement_type) - Location: (12221,12336)(12221,12336)
+ PsiTypeQLElement(type_any) - Location: (12221,12234)(12221,12234)
+ PsiTypeQLType(type) - Name: characterizes - Location: (12221,12234)(12221,12234)
+ PsiTypeQLElement(label) - Location: (12221,12234)(12221,12234)
+ PsiElement(LABEL_)('characterizes')(12221,12234)
+ PsiWhiteSpace(' ')(12234,12235)
+ PsiTypeQLSubType(type_constraint) - Location: (12235,12261)(12235,12261)
+ PsiElement(SUB_)('sub')(12235,12238)
+ PsiWhiteSpace(' ')(12238,12239)
+ PsiTypeQLElement(type_any) - Location: (12239,12261)(12239,12261)
+ PsiTypeQLElement(type) - Location: (12239,12261)(12239,12261)
+ PsiTypeQLElement(label) - Location: (12239,12261)(12239,12261)
+ PsiElement(LABEL_)('stix-core-relationship')(12239,12261)
+ PsiElement(',')(',')(12261,12262)
+ PsiWhiteSpace('\n ')(12262,12267)
+ PsiTypeQLRelatesType(type_constraint) - Name: characterizing - Location: (12267,12289)(12267,12299)
+ PsiElement('relates')('relates')(12267,12274)
+ PsiWhiteSpace(' ')(12274,12275)
+ PsiTypeQLElement(type) - Location: (12275,12289)(12275,12289)
+ PsiTypeQLElement(label) - Location: (12275,12289)(12275,12289)
+ PsiElement(LABEL_)('characterizing')(12275,12289)
+ PsiWhiteSpace(' ')(12289,12290)
+ PsiElement('as')('as')(12290,12292)
+ PsiWhiteSpace(' ')(12292,12293)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12293,12299)(12293,12299)
+ PsiTypeQLElement(label) - Location: (12293,12299)(12293,12299)
+ PsiElement(LABEL_)('source')(12293,12299)
+ PsiElement(',')(',')(12299,12300)
+ PsiWhiteSpace('\n ')(12300,12305)
+ PsiTypeQLRelatesType(type_constraint) - Name: characterized - Location: (12305,12326)(12305,12336)
+ PsiElement('relates')('relates')(12305,12312)
+ PsiWhiteSpace(' ')(12312,12313)
+ PsiTypeQLElement(type) - Location: (12313,12326)(12313,12326)
+ PsiTypeQLElement(label) - Location: (12313,12326)(12313,12326)
+ PsiElement(LABEL_)('characterized')(12313,12326)
+ PsiWhiteSpace(' ')(12326,12327)
+ PsiElement('as')('as')(12327,12329)
+ PsiWhiteSpace(' ')(12329,12330)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12330,12336)(12330,12336)
+ PsiTypeQLElement(label) - Location: (12330,12336)(12330,12336)
+ PsiElement(LABEL_)('target')(12330,12336)
+ PsiElement(';')(';')(12336,12337)
+ PsiWhiteSpace('\n\n')(12337,12339)
+ PsiTypeQLElement(definable) - Location: (12339,12439)(12339,12439)
+ PsiTypeQLStatementType(statement_type) - Location: (12339,12439)(12339,12439)
+ PsiTypeQLElement(type_any) - Location: (12339,12347)(12339,12347)
+ PsiTypeQLType(type) - Name: analysis - Location: (12339,12347)(12339,12347)
+ PsiTypeQLElement(label) - Location: (12339,12347)(12339,12347)
+ PsiElement(LABEL_)('analysis')(12339,12347)
+ PsiWhiteSpace(' ')(12347,12348)
+ PsiTypeQLSubType(type_constraint) - Location: (12348,12374)(12348,12374)
+ PsiElement(SUB_)('sub')(12348,12351)
+ PsiWhiteSpace(' ')(12351,12352)
+ PsiTypeQLElement(type_any) - Location: (12352,12374)(12352,12374)
+ PsiTypeQLElement(type) - Location: (12352,12374)(12352,12374)
+ PsiTypeQLElement(label) - Location: (12352,12374)(12352,12374)
+ PsiElement(LABEL_)('stix-core-relationship')(12352,12374)
+ PsiElement(',')(',')(12374,12375)
+ PsiWhiteSpace('\n ')(12375,12380)
+ PsiTypeQLRelatesType(type_constraint) - Name: analysing - Location: (12380,12397)(12380,12407)
+ PsiElement('relates')('relates')(12380,12387)
+ PsiWhiteSpace(' ')(12387,12388)
+ PsiTypeQLElement(type) - Location: (12388,12397)(12388,12397)
+ PsiTypeQLElement(label) - Location: (12388,12397)(12388,12397)
+ PsiElement(LABEL_)('analysing')(12388,12397)
+ PsiWhiteSpace(' ')(12397,12398)
+ PsiElement('as')('as')(12398,12400)
+ PsiWhiteSpace(' ')(12400,12401)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12401,12407)(12401,12407)
+ PsiTypeQLElement(label) - Location: (12401,12407)(12401,12407)
+ PsiElement(LABEL_)('source')(12401,12407)
+ PsiElement(',')(',')(12407,12408)
+ PsiWhiteSpace('\n ')(12408,12413)
+ PsiTypeQLRelatesType(type_constraint) - Name: analysed - Location: (12413,12429)(12413,12439)
+ PsiElement('relates')('relates')(12413,12420)
+ PsiWhiteSpace(' ')(12420,12421)
+ PsiTypeQLElement(type) - Location: (12421,12429)(12421,12429)
+ PsiTypeQLElement(label) - Location: (12421,12429)(12421,12429)
+ PsiElement(LABEL_)('analysed')(12421,12429)
+ PsiWhiteSpace(' ')(12429,12430)
+ PsiElement('as')('as')(12430,12432)
+ PsiWhiteSpace(' ')(12432,12433)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12433,12439)(12433,12439)
+ PsiTypeQLElement(label) - Location: (12433,12439)(12433,12439)
+ PsiElement(LABEL_)('target')(12433,12439)
+ PsiElement(';')(';')(12439,12440)
+ PsiWhiteSpace('\n\n')(12440,12442)
+ PsiTypeQLElement(definable) - Location: (12442,12466)(12442,12466)
+ PsiTypeQLStatementType(statement_type) - Location: (12442,12466)(12442,12466)
+ PsiTypeQLElement(type_any) - Location: (12442,12453)(12442,12453)
+ PsiTypeQLType(type) - Name: analysis-of - Location: (12442,12453)(12442,12453)
+ PsiTypeQLElement(label) - Location: (12442,12453)(12442,12453)
+ PsiElement(LABEL_)('analysis-of')(12442,12453)
+ PsiWhiteSpace(' ')(12453,12454)
+ PsiTypeQLSubType(type_constraint) - Location: (12454,12466)(12454,12466)
+ PsiElement(SUB_)('sub')(12454,12457)
+ PsiWhiteSpace(' ')(12457,12458)
+ PsiTypeQLElement(type_any) - Location: (12458,12466)(12458,12466)
+ PsiTypeQLElement(type) - Location: (12458,12466)(12458,12466)
+ PsiTypeQLElement(label) - Location: (12458,12466)(12458,12466)
+ PsiElement(LABEL_)('analysis')(12458,12466)
+ PsiElement(';')(';')(12466,12467)
+ PsiWhiteSpace('\n')(12467,12468)
+ PsiTypeQLElement(definable) - Location: (12468,12499)(12468,12499)
+ PsiTypeQLStatementType(statement_type) - Location: (12468,12499)(12468,12499)
+ PsiTypeQLElement(type_any) - Location: (12468,12486)(12468,12486)
+ PsiTypeQLType(type) - Name: static-analysis-of - Location: (12468,12486)(12468,12486)
+ PsiTypeQLElement(label) - Location: (12468,12486)(12468,12486)
+ PsiElement(LABEL_)('static-analysis-of')(12468,12486)
+ PsiWhiteSpace(' ')(12486,12487)
+ PsiTypeQLSubType(type_constraint) - Location: (12487,12499)(12487,12499)
+ PsiElement(SUB_)('sub')(12487,12490)
+ PsiWhiteSpace(' ')(12490,12491)
+ PsiTypeQLElement(type_any) - Location: (12491,12499)(12491,12499)
+ PsiTypeQLElement(type) - Location: (12491,12499)(12491,12499)
+ PsiTypeQLElement(label) - Location: (12491,12499)(12491,12499)
+ PsiElement(LABEL_)('analysis')(12491,12499)
+ PsiElement(';')(';')(12499,12500)
+ PsiWhiteSpace('\n')(12500,12501)
+ PsiTypeQLElement(definable) - Location: (12501,12533)(12501,12533)
+ PsiTypeQLStatementType(statement_type) - Location: (12501,12533)(12501,12533)
+ PsiTypeQLElement(type_any) - Location: (12501,12520)(12501,12520)
+ PsiTypeQLType(type) - Name: dynamic-analysis-of - Location: (12501,12520)(12501,12520)
+ PsiTypeQLElement(label) - Location: (12501,12520)(12501,12520)
+ PsiElement(LABEL_)('dynamic-analysis-of')(12501,12520)
+ PsiWhiteSpace(' ')(12520,12521)
+ PsiTypeQLSubType(type_constraint) - Location: (12521,12533)(12521,12533)
+ PsiElement(SUB_)('sub')(12521,12524)
+ PsiWhiteSpace(' ')(12524,12525)
+ PsiTypeQLElement(type_any) - Location: (12525,12533)(12525,12533)
+ PsiTypeQLElement(type) - Location: (12525,12533)(12525,12533)
+ PsiTypeQLElement(label) - Location: (12525,12533)(12525,12533)
+ PsiElement(LABEL_)('analysis')(12525,12533)
+ PsiElement(';')(';')(12533,12534)
+ PsiWhiteSpace('\n\n')(12534,12536)
+ PsiTypeQLElement(definable) - Location: (12536,12632)(12536,12632)
+ PsiTypeQLStatementType(statement_type) - Location: (12536,12632)(12536,12632)
+ PsiTypeQLElement(type_any) - Location: (12536,12546)(12536,12546)
+ PsiTypeQLType(type) - Name: ownerships - Location: (12536,12546)(12536,12546)
+ PsiTypeQLElement(label) - Location: (12536,12546)(12536,12546)
+ PsiElement(LABEL_)('ownerships')(12536,12546)
+ PsiWhiteSpace(' ')(12546,12547)
+ PsiTypeQLSubType(type_constraint) - Location: (12547,12573)(12547,12573)
+ PsiElement(SUB_)('sub')(12547,12550)
+ PsiWhiteSpace(' ')(12550,12551)
+ PsiTypeQLElement(type_any) - Location: (12551,12573)(12551,12573)
+ PsiTypeQLElement(type) - Location: (12551,12573)(12551,12573)
+ PsiTypeQLElement(label) - Location: (12551,12573)(12551,12573)
+ PsiElement(LABEL_)('stix-core-relationship')(12551,12573)
+ PsiElement(',')(',')(12573,12574)
+ PsiWhiteSpace('\n ')(12574,12579)
+ PsiTypeQLRelatesType(type_constraint) - Name: owning - Location: (12579,12593)(12579,12603)
+ PsiElement('relates')('relates')(12579,12586)
+ PsiWhiteSpace(' ')(12586,12587)
+ PsiTypeQLElement(type) - Location: (12587,12593)(12587,12593)
+ PsiTypeQLElement(label) - Location: (12587,12593)(12587,12593)
+ PsiElement(LABEL_)('owning')(12587,12593)
+ PsiWhiteSpace(' ')(12593,12594)
+ PsiElement('as')('as')(12594,12596)
+ PsiWhiteSpace(' ')(12596,12597)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12597,12603)(12597,12603)
+ PsiTypeQLElement(label) - Location: (12597,12603)(12597,12603)
+ PsiElement(LABEL_)('source')(12597,12603)
+ PsiElement(',')(',')(12603,12604)
+ PsiWhiteSpace('\n ')(12604,12609)
+ PsiTypeQLRelatesType(type_constraint) - Name: owned - Location: (12609,12622)(12609,12632)
+ PsiElement('relates')('relates')(12609,12616)
+ PsiWhiteSpace(' ')(12616,12617)
+ PsiTypeQLElement(type) - Location: (12617,12622)(12617,12622)
+ PsiTypeQLElement(label) - Location: (12617,12622)(12617,12622)
+ PsiElement(LABEL_)('owned')(12617,12622)
+ PsiWhiteSpace(' ')(12622,12623)
+ PsiElement('as')('as')(12623,12625)
+ PsiWhiteSpace(' ')(12625,12626)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12626,12632)(12626,12632)
+ PsiTypeQLElement(label) - Location: (12626,12632)(12626,12632)
+ PsiElement(LABEL_)('target')(12626,12632)
+ PsiElement(';')(';')(12632,12633)
+ PsiWhiteSpace('\n\n')(12633,12635)
+ PsiTypeQLElement(definable) - Location: (12635,12691)(12635,12691)
+ PsiTypeQLStatementType(statement_type) - Location: (12635,12691)(12635,12691)
+ PsiTypeQLElement(type_any) - Location: (12635,12638)(12635,12638)
+ PsiTypeQLType(type) - Name: ref - Location: (12635,12638)(12635,12638)
+ PsiTypeQLElement(label) - Location: (12635,12638)(12635,12638)
+ PsiElement(LABEL_)('ref')(12635,12638)
+ PsiWhiteSpace(' ')(12638,12639)
+ PsiTypeQLElement(type_constraint) - Location: (12639,12651)(12639,12651)
+ PsiElement(SUB_)('sub')(12639,12642)
+ PsiWhiteSpace(' ')(12642,12643)
+ PsiTypeQLElement(type_any) - Location: (12643,12651)(12643,12651)
+ PsiTypeQLElement(type) - Location: (12643,12651)(12643,12651)
+ PsiTypeQLElement(label) - Location: (12643,12651)(12643,12651)
+ PsiTypeQLElement(type_native) - Location: (12643,12651)(12643,12651)
+ PsiElement('relation')('relation')(12643,12651)
+ PsiElement(',')(',')(12651,12652)
+ PsiWhiteSpace('\n ')(12652,12657)
+ PsiTypeQLRelatesType(type_constraint) - Name: source - Location: (12657,12671)(12657,12671)
+ PsiElement('relates')('relates')(12657,12664)
+ PsiWhiteSpace(' ')(12664,12665)
+ PsiTypeQLElement(type) - Location: (12665,12671)(12665,12671)
+ PsiTypeQLElement(label) - Location: (12665,12671)(12665,12671)
+ PsiElement(LABEL_)('source')(12665,12671)
+ PsiElement(',')(',')(12671,12672)
+ PsiWhiteSpace('\n ')(12672,12677)
+ PsiTypeQLRelatesType(type_constraint) - Name: target - Location: (12677,12691)(12677,12691)
+ PsiElement('relates')('relates')(12677,12684)
+ PsiWhiteSpace(' ')(12684,12685)
+ PsiTypeQLElement(type) - Location: (12685,12691)(12685,12691)
+ PsiTypeQLElement(label) - Location: (12685,12691)(12685,12691)
+ PsiElement(LABEL_)('target')(12685,12691)
+ PsiElement(';')(';')(12691,12692)
+ PsiWhiteSpace('\n\n')(12692,12694)
+ PsiTypeQLElement(definable) - Location: (12694,12710)(12694,12710)
+ PsiTypeQLStatementType(statement_type) - Location: (12694,12710)(12694,12710)
+ PsiTypeQLElement(type_any) - Location: (12694,12702)(12694,12702)
+ PsiTypeQLType(type) - Name: from-ref - Location: (12694,12702)(12694,12702)
+ PsiTypeQLElement(label) - Location: (12694,12702)(12694,12702)
+ PsiElement(LABEL_)('from-ref')(12694,12702)
+ PsiWhiteSpace(' ')(12702,12703)
+ PsiTypeQLSubType(type_constraint) - Location: (12703,12710)(12703,12710)
+ PsiElement(SUB_)('sub')(12703,12706)
+ PsiWhiteSpace(' ')(12706,12707)
+ PsiTypeQLElement(type_any) - Location: (12707,12710)(12707,12710)
+ PsiTypeQLElement(type) - Location: (12707,12710)(12707,12710)
+ PsiTypeQLElement(label) - Location: (12707,12710)(12707,12710)
+ PsiElement(LABEL_)('ref')(12707,12710)
+ PsiElement(';')(';')(12710,12711)
+ PsiWhiteSpace('\n')(12711,12712)
+ PsiTypeQLElement(definable) - Location: (12712,12730)(12712,12730)
+ PsiTypeQLStatementType(statement_type) - Location: (12712,12730)(12712,12730)
+ PsiTypeQLElement(type_any) - Location: (12712,12722)(12712,12722)
+ PsiTypeQLType(type) - Name: sender-ref - Location: (12712,12722)(12712,12722)
+ PsiTypeQLElement(label) - Location: (12712,12722)(12712,12722)
+ PsiElement(LABEL_)('sender-ref')(12712,12722)
+ PsiWhiteSpace(' ')(12722,12723)
+ PsiTypeQLSubType(type_constraint) - Location: (12723,12730)(12723,12730)
+ PsiElement(SUB_)('sub')(12723,12726)
+ PsiWhiteSpace(' ')(12726,12727)
+ PsiTypeQLElement(type_any) - Location: (12727,12730)(12727,12730)
+ PsiTypeQLElement(type) - Location: (12727,12730)(12727,12730)
+ PsiTypeQLElement(label) - Location: (12727,12730)(12727,12730)
+ PsiElement(LABEL_)('ref')(12727,12730)
+ PsiElement(';')(';')(12730,12731)
+ PsiWhiteSpace('\n')(12731,12732)
+ PsiTypeQLElement(definable) - Location: (12732,12753)(12732,12753)
+ PsiTypeQLStatementType(statement_type) - Location: (12732,12753)(12732,12753)
+ PsiTypeQLElement(type_any) - Location: (12732,12745)(12732,12745)
+ PsiTypeQLType(type) - Name: raw-email-ref - Location: (12732,12745)(12732,12745)
+ PsiTypeQLElement(label) - Location: (12732,12745)(12732,12745)
+ PsiElement(LABEL_)('raw-email-ref')(12732,12745)
+ PsiWhiteSpace(' ')(12745,12746)
+ PsiTypeQLSubType(type_constraint) - Location: (12746,12753)(12746,12753)
+ PsiElement(SUB_)('sub')(12746,12749)
+ PsiWhiteSpace(' ')(12749,12750)
+ PsiTypeQLElement(type_any) - Location: (12750,12753)(12750,12753)
+ PsiTypeQLElement(type) - Location: (12750,12753)(12750,12753)
+ PsiTypeQLElement(label) - Location: (12750,12753)(12750,12753)
+ PsiElement(LABEL_)('ref')(12750,12753)
+ PsiElement(';')(';')(12753,12754)
+ PsiWhiteSpace('\n')(12754,12755)
+ PsiTypeQLElement(definable) - Location: (12755,12775)(12755,12775)
+ PsiTypeQLStatementType(statement_type) - Location: (12755,12775)(12755,12775)
+ PsiTypeQLElement(type_any) - Location: (12755,12767)(12755,12767)
+ PsiTypeQLType(type) - Name: body-raw-ref - Location: (12755,12767)(12755,12767)
+ PsiTypeQLElement(label) - Location: (12755,12767)(12755,12767)
+ PsiElement(LABEL_)('body-raw-ref')(12755,12767)
+ PsiWhiteSpace(' ')(12767,12768)
+ PsiTypeQLSubType(type_constraint) - Location: (12768,12775)(12768,12775)
+ PsiElement(SUB_)('sub')(12768,12771)
+ PsiWhiteSpace(' ')(12771,12772)
+ PsiTypeQLElement(type_any) - Location: (12772,12775)(12772,12775)
+ PsiTypeQLElement(type) - Location: (12772,12775)(12772,12775)
+ PsiTypeQLElement(label) - Location: (12772,12775)(12772,12775)
+ PsiElement(LABEL_)('ref')(12772,12775)
+ PsiElement(';')(';')(12775,12776)
+ PsiWhiteSpace('\n')(12776,12777)
+ PsiTypeQLElement(definable) - Location: (12777,12805)(12777,12805)
+ PsiTypeQLStatementType(statement_type) - Location: (12777,12805)(12777,12805)
+ PsiTypeQLElement(type_any) - Location: (12777,12797)(12777,12797)
+ PsiTypeQLType(type) - Name: parent-directory-ref - Location: (12777,12797)(12777,12797)
+ PsiTypeQLElement(label) - Location: (12777,12797)(12777,12797)
+ PsiElement(LABEL_)('parent-directory-ref')(12777,12797)
+ PsiWhiteSpace(' ')(12797,12798)
+ PsiTypeQLSubType(type_constraint) - Location: (12798,12805)(12798,12805)
+ PsiElement(SUB_)('sub')(12798,12801)
+ PsiWhiteSpace(' ')(12801,12802)
+ PsiTypeQLElement(type_any) - Location: (12802,12805)(12802,12805)
+ PsiTypeQLElement(type) - Location: (12802,12805)(12802,12805)
+ PsiTypeQLElement(label) - Location: (12802,12805)(12802,12805)
+ PsiElement(LABEL_)('ref')(12802,12805)
+ PsiElement(';')(';')(12805,12806)
+ PsiWhiteSpace('\n')(12806,12807)
+ PsiTypeQLElement(definable) - Location: (12807,12826)(12807,12826)
+ PsiTypeQLStatementType(statement_type) - Location: (12807,12826)(12807,12826)
+ PsiTypeQLElement(type_any) - Location: (12807,12818)(12807,12818)
+ PsiTypeQLType(type) - Name: content-ref - Location: (12807,12818)(12807,12818)
+ PsiTypeQLElement(label) - Location: (12807,12818)(12807,12818)
+ PsiElement(LABEL_)('content-ref')(12807,12818)
+ PsiWhiteSpace(' ')(12818,12819)
+ PsiTypeQLSubType(type_constraint) - Location: (12819,12826)(12819,12826)
+ PsiElement(SUB_)('sub')(12819,12822)
+ PsiWhiteSpace(' ')(12822,12823)
+ PsiTypeQLElement(type_any) - Location: (12823,12826)(12823,12826)
+ PsiTypeQLElement(type) - Location: (12823,12826)(12823,12826)
+ PsiTypeQLElement(label) - Location: (12823,12826)(12823,12826)
+ PsiElement(LABEL_)('ref')(12823,12826)
+ PsiElement(';')(';')(12826,12827)
+ PsiWhiteSpace('\n')(12827,12828)
+ PsiTypeQLElement(definable) - Location: (12828,12879)(12828,12879)
+ PsiTypeQLStatementType(statement_type) - Location: (12828,12879)(12828,12879)
+ PsiTypeQLElement(type_any) - Location: (12828,12843)(12828,12843)
+ PsiTypeQLType(type) - Name: optional-header - Location: (12828,12843)(12828,12843)
+ PsiTypeQLElement(label) - Location: (12828,12843)(12828,12843)
+ PsiElement(LABEL_)('optional-header')(12828,12843)
+ PsiWhiteSpace(' ')(12843,12844)
+ PsiTypeQLSubType(type_constraint) - Location: (12844,12851)(12844,12851)
+ PsiElement(SUB_)('sub')(12844,12847)
+ PsiWhiteSpace(' ')(12847,12848)
+ PsiTypeQLElement(type_any) - Location: (12848,12851)(12848,12851)
+ PsiTypeQLElement(type) - Location: (12848,12851)(12848,12851)
+ PsiTypeQLElement(label) - Location: (12848,12851)(12848,12851)
+ PsiElement(LABEL_)('ref')(12848,12851)
+ PsiElement(',')(',')(12851,12852)
+ PsiWhiteSpace('\n ')(12852,12857)
+ PsiTypeQLRelatesType(type_constraint) - Name: from - Location: (12857,12869)(12857,12879)
+ PsiElement('relates')('relates')(12857,12864)
+ PsiWhiteSpace(' ')(12864,12865)
+ PsiTypeQLElement(type) - Location: (12865,12869)(12865,12869)
+ PsiTypeQLElement(label) - Location: (12865,12869)(12865,12869)
+ PsiElement(LABEL_)('from')(12865,12869)
+ PsiWhiteSpace(' ')(12869,12870)
+ PsiElement('as')('as')(12870,12872)
+ PsiWhiteSpace(' ')(12872,12873)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (12873,12879)(12873,12879)
+ PsiTypeQLElement(label) - Location: (12873,12879)(12873,12879)
+ PsiElement(LABEL_)('source')(12873,12879)
+ PsiElement(';')(';')(12879,12880)
+ PsiWhiteSpace('\n')(12880,12881)
+ PsiTypeQLElement(definable) - Location: (12881,12903)(12881,12903)
+ PsiTypeQLStatementType(statement_type) - Location: (12881,12903)(12881,12903)
+ PsiTypeQLElement(type_any) - Location: (12881,12895)(12881,12895)
+ PsiTypeQLType(type) - Name: belongs-to-ref - Location: (12881,12895)(12881,12895)
+ PsiTypeQLElement(label) - Location: (12881,12895)(12881,12895)
+ PsiElement(LABEL_)('belongs-to-ref')(12881,12895)
+ PsiWhiteSpace(' ')(12895,12896)
+ PsiTypeQLSubType(type_constraint) - Location: (12896,12903)(12896,12903)
+ PsiElement(SUB_)('sub')(12896,12899)
+ PsiWhiteSpace(' ')(12899,12900)
+ PsiTypeQLElement(type_any) - Location: (12900,12903)(12900,12903)
+ PsiTypeQLElement(type) - Location: (12900,12903)(12900,12903)
+ PsiTypeQLElement(label) - Location: (12900,12903)(12900,12903)
+ PsiElement(LABEL_)('ref')(12900,12903)
+ PsiElement(';')(';')(12903,12904)
+ PsiWhiteSpace('\n')(12904,12905)
+ PsiTypeQLElement(definable) - Location: (12905,12920)(12905,12920)
+ PsiTypeQLStatementType(statement_type) - Location: (12905,12920)(12905,12920)
+ PsiTypeQLElement(type_any) - Location: (12905,12912)(12905,12912)
+ PsiTypeQLType(type) - Name: src-ref - Location: (12905,12912)(12905,12912)
+ PsiTypeQLElement(label) - Location: (12905,12912)(12905,12912)
+ PsiElement(LABEL_)('src-ref')(12905,12912)
+ PsiWhiteSpace(' ')(12912,12913)
+ PsiTypeQLSubType(type_constraint) - Location: (12913,12920)(12913,12920)
+ PsiElement(SUB_)('sub')(12913,12916)
+ PsiWhiteSpace(' ')(12916,12917)
+ PsiTypeQLElement(type_any) - Location: (12917,12920)(12917,12920)
+ PsiTypeQLElement(type) - Location: (12917,12920)(12917,12920)
+ PsiTypeQLElement(label) - Location: (12917,12920)(12917,12920)
+ PsiElement(LABEL_)('ref')(12917,12920)
+ PsiElement(';')(';')(12920,12921)
+ PsiWhiteSpace('\n')(12921,12922)
+ PsiTypeQLElement(definable) - Location: (12922,12937)(12922,12937)
+ PsiTypeQLStatementType(statement_type) - Location: (12922,12937)(12922,12937)
+ PsiTypeQLElement(type_any) - Location: (12922,12929)(12922,12929)
+ PsiTypeQLType(type) - Name: dst-ref - Location: (12922,12929)(12922,12929)
+ PsiTypeQLElement(label) - Location: (12922,12929)(12922,12929)
+ PsiElement(LABEL_)('dst-ref')(12922,12929)
+ PsiWhiteSpace(' ')(12929,12930)
+ PsiTypeQLSubType(type_constraint) - Location: (12930,12937)(12930,12937)
+ PsiElement(SUB_)('sub')(12930,12933)
+ PsiWhiteSpace(' ')(12933,12934)
+ PsiTypeQLElement(type_any) - Location: (12934,12937)(12934,12937)
+ PsiTypeQLElement(type) - Location: (12934,12937)(12934,12937)
+ PsiTypeQLElement(label) - Location: (12934,12937)(12934,12937)
+ PsiElement(LABEL_)('ref')(12934,12937)
+ PsiElement(';')(';')(12937,12938)
+ PsiWhiteSpace('\n')(12938,12939)
+ PsiTypeQLElement(definable) - Location: (12939,12962)(12939,12962)
+ PsiTypeQLStatementType(statement_type) - Location: (12939,12962)(12939,12962)
+ PsiTypeQLElement(type_any) - Location: (12939,12954)(12939,12954)
+ PsiTypeQLType(type) - Name: src-payload-ref - Location: (12939,12954)(12939,12954)
+ PsiTypeQLElement(label) - Location: (12939,12954)(12939,12954)
+ PsiElement(LABEL_)('src-payload-ref')(12939,12954)
+ PsiWhiteSpace(' ')(12954,12955)
+ PsiTypeQLSubType(type_constraint) - Location: (12955,12962)(12955,12962)
+ PsiElement(SUB_)('sub')(12955,12958)
+ PsiWhiteSpace(' ')(12958,12959)
+ PsiTypeQLElement(type_any) - Location: (12959,12962)(12959,12962)
+ PsiTypeQLElement(type) - Location: (12959,12962)(12959,12962)
+ PsiTypeQLElement(label) - Location: (12959,12962)(12959,12962)
+ PsiElement(LABEL_)('ref')(12959,12962)
+ PsiElement(';')(';')(12962,12963)
+ PsiWhiteSpace('\n')(12963,12964)
+ PsiTypeQLElement(definable) - Location: (12964,12987)(12964,12987)
+ PsiTypeQLStatementType(statement_type) - Location: (12964,12987)(12964,12987)
+ PsiTypeQLElement(type_any) - Location: (12964,12979)(12964,12979)
+ PsiTypeQLType(type) - Name: dst-payload-ref - Location: (12964,12979)(12964,12979)
+ PsiTypeQLElement(label) - Location: (12964,12979)(12964,12979)
+ PsiElement(LABEL_)('dst-payload-ref')(12964,12979)
+ PsiWhiteSpace(' ')(12979,12980)
+ PsiTypeQLSubType(type_constraint) - Location: (12980,12987)(12980,12987)
+ PsiElement(SUB_)('sub')(12980,12983)
+ PsiWhiteSpace(' ')(12983,12984)
+ PsiTypeQLElement(type_any) - Location: (12984,12987)(12984,12987)
+ PsiTypeQLElement(type) - Location: (12984,12987)(12984,12987)
+ PsiTypeQLElement(label) - Location: (12984,12987)(12984,12987)
+ PsiElement(LABEL_)('ref')(12984,12987)
+ PsiElement(';')(';')(12987,12988)
+ PsiWhiteSpace('\n')(12988,12989)
+ PsiTypeQLElement(definable) - Location: (12989,13016)(12989,13016)
+ PsiTypeQLStatementType(statement_type) - Location: (12989,13016)(12989,13016)
+ PsiTypeQLElement(type_any) - Location: (12989,13008)(12989,13008)
+ PsiTypeQLType(type) - Name: encapsulated-by-ref - Location: (12989,13008)(12989,13008)
+ PsiTypeQLElement(label) - Location: (12989,13008)(12989,13008)
+ PsiElement(LABEL_)('encapsulated-by-ref')(12989,13008)
+ PsiWhiteSpace(' ')(13008,13009)
+ PsiTypeQLSubType(type_constraint) - Location: (13009,13016)(13009,13016)
+ PsiElement(SUB_)('sub')(13009,13012)
+ PsiWhiteSpace(' ')(13012,13013)
+ PsiTypeQLElement(type_any) - Location: (13013,13016)(13013,13016)
+ PsiTypeQLElement(type) - Location: (13013,13016)(13013,13016)
+ PsiTypeQLElement(label) - Location: (13013,13016)(13013,13016)
+ PsiElement(LABEL_)('ref')(13013,13016)
+ PsiElement(';')(';')(13016,13017)
+ PsiWhiteSpace('\n')(13017,13018)
+ PsiTypeQLElement(definable) - Location: (13018,13047)(13018,13047)
+ PsiTypeQLStatementType(statement_type) - Location: (13018,13047)(13018,13047)
+ PsiTypeQLElement(type_any) - Location: (13018,13039)(13018,13039)
+ PsiTypeQLType(type) - Name: massage-body-data-ref - Location: (13018,13039)(13018,13039)
+ PsiTypeQLElement(label) - Location: (13018,13039)(13018,13039)
+ PsiElement(LABEL_)('massage-body-data-ref')(13018,13039)
+ PsiWhiteSpace(' ')(13039,13040)
+ PsiTypeQLSubType(type_constraint) - Location: (13040,13047)(13040,13047)
+ PsiElement(SUB_)('sub')(13040,13043)
+ PsiWhiteSpace(' ')(13043,13044)
+ PsiTypeQLElement(type_any) - Location: (13044,13047)(13044,13047)
+ PsiTypeQLElement(type) - Location: (13044,13047)(13044,13047)
+ PsiTypeQLElement(label) - Location: (13044,13047)(13044,13047)
+ PsiElement(LABEL_)('ref')(13044,13047)
+ PsiElement(';')(';')(13047,13048)
+ PsiWhiteSpace('\n')(13048,13049)
+ PsiTypeQLElement(definable) - Location: (13049,13073)(13049,13073)
+ PsiTypeQLStatementType(statement_type) - Location: (13049,13073)(13049,13073)
+ PsiTypeQLElement(type_any) - Location: (13049,13065)(13049,13065)
+ PsiTypeQLType(type) - Name: creator-user-ref - Location: (13049,13065)(13049,13065)
+ PsiTypeQLElement(label) - Location: (13049,13065)(13049,13065)
+ PsiElement(LABEL_)('creator-user-ref')(13049,13065)
+ PsiWhiteSpace(' ')(13065,13066)
+ PsiTypeQLSubType(type_constraint) - Location: (13066,13073)(13066,13073)
+ PsiElement(SUB_)('sub')(13066,13069)
+ PsiWhiteSpace(' ')(13069,13070)
+ PsiTypeQLElement(type_any) - Location: (13070,13073)(13070,13073)
+ PsiTypeQLElement(type) - Location: (13070,13073)(13070,13073)
+ PsiTypeQLElement(label) - Location: (13070,13073)(13070,13073)
+ PsiElement(LABEL_)('ref')(13070,13073)
+ PsiElement(';')(';')(13073,13074)
+ PsiWhiteSpace('\n')(13074,13075)
+ PsiTypeQLElement(definable) - Location: (13075,13092)(13075,13092)
+ PsiTypeQLStatementType(statement_type) - Location: (13075,13092)(13075,13092)
+ PsiTypeQLElement(type_any) - Location: (13075,13084)(13075,13084)
+ PsiTypeQLType(type) - Name: image-ref - Location: (13075,13084)(13075,13084)
+ PsiTypeQLElement(label) - Location: (13075,13084)(13075,13084)
+ PsiElement(LABEL_)('image-ref')(13075,13084)
+ PsiWhiteSpace(' ')(13084,13085)
+ PsiTypeQLSubType(type_constraint) - Location: (13085,13092)(13085,13092)
+ PsiElement(SUB_)('sub')(13085,13088)
+ PsiWhiteSpace(' ')(13088,13089)
+ PsiTypeQLElement(type_any) - Location: (13089,13092)(13089,13092)
+ PsiTypeQLElement(type) - Location: (13089,13092)(13089,13092)
+ PsiTypeQLElement(label) - Location: (13089,13092)(13089,13092)
+ PsiElement(LABEL_)('ref')(13089,13092)
+ PsiElement(';')(';')(13092,13093)
+ PsiWhiteSpace('\n')(13093,13094)
+ PsiTypeQLElement(definable) - Location: (13094,13112)(13094,13112)
+ PsiTypeQLStatementType(statement_type) - Location: (13094,13112)(13094,13112)
+ PsiTypeQLElement(type_any) - Location: (13094,13104)(13094,13104)
+ PsiTypeQLType(type) - Name: parent-ref - Location: (13094,13104)(13094,13104)
+ PsiTypeQLElement(label) - Location: (13094,13104)(13094,13104)
+ PsiElement(LABEL_)('parent-ref')(13094,13104)
+ PsiWhiteSpace(' ')(13104,13105)
+ PsiTypeQLSubType(type_constraint) - Location: (13105,13112)(13105,13112)
+ PsiElement(SUB_)('sub')(13105,13108)
+ PsiWhiteSpace(' ')(13108,13109)
+ PsiTypeQLElement(type_any) - Location: (13109,13112)(13109,13112)
+ PsiTypeQLElement(type) - Location: (13109,13112)(13109,13112)
+ PsiTypeQLElement(label) - Location: (13109,13112)(13109,13112)
+ PsiElement(LABEL_)('ref')(13109,13112)
+ PsiElement(';')(';')(13112,13113)
+ PsiWhiteSpace('\n')(13113,13114)
+ PsiTypeQLElement(definable) - Location: (13114,13171)(13114,13171)
+ PsiTypeQLStatementType(statement_type) - Location: (13114,13171)(13114,13171)
+ PsiTypeQLElement(type_any) - Location: (13114,13135)(13114,13135)
+ PsiTypeQLType(type) - Name: message-body-data-ref - Location: (13114,13135)(13114,13135)
+ PsiTypeQLElement(label) - Location: (13114,13135)(13114,13135)
+ PsiElement(LABEL_)('message-body-data-ref')(13114,13135)
+ PsiWhiteSpace(' ')(13135,13136)
+ PsiTypeQLSubType(type_constraint) - Location: (13136,13143)(13136,13143)
+ PsiElement(SUB_)('sub')(13136,13139)
+ PsiWhiteSpace(' ')(13139,13140)
+ PsiTypeQLElement(type_any) - Location: (13140,13143)(13140,13143)
+ PsiTypeQLElement(type) - Location: (13140,13143)(13140,13143)
+ PsiTypeQLElement(label) - Location: (13140,13143)(13140,13143)
+ PsiElement(LABEL_)('ref')(13140,13143)
+ PsiElement(',')(',')(13143,13144)
+ PsiWhiteSpace('\n ')(13144,13149)
+ PsiTypeQLRelatesType(type_constraint) - Name: from - Location: (13149,13161)(13149,13171)
+ PsiElement('relates')('relates')(13149,13156)
+ PsiWhiteSpace(' ')(13156,13157)
+ PsiTypeQLElement(type) - Location: (13157,13161)(13157,13161)
+ PsiTypeQLElement(label) - Location: (13157,13161)(13157,13161)
+ PsiElement(LABEL_)('from')(13157,13161)
+ PsiWhiteSpace(' ')(13161,13162)
+ PsiElement('as')('as')(13162,13164)
+ PsiWhiteSpace(' ')(13164,13165)
+ PsiTypeQLRelatesAsOverrideType(type) - Location: (13165,13171)(13165,13171)
+ PsiTypeQLElement(label) - Location: (13165,13171)(13165,13171)
+ PsiElement(LABEL_)('source')(13165,13171)
+ PsiElement(';')(';')(13171,13172)
+ PsiWhiteSpace('\n\n')(13172,13174)
+ PsiTypeQLElement(definable) - Location: (13174,13245)(13174,13245)
+ PsiTypeQLStatementType(statement_type) - Location: (13174,13245)(13174,13245)
+ PsiTypeQLElement(type_any) - Location: (13174,13184)(13174,13184)
+ PsiTypeQLType(type) - Name: derivation - Location: (13174,13184)(13174,13184)
+ PsiTypeQLElement(label) - Location: (13174,13184)(13174,13184)
+ PsiElement(LABEL_)('derivation')(13174,13184)
+ PsiWhiteSpace(' ')(13184,13185)
+ PsiTypeQLElement(type_constraint) - Location: (13185,13197)(13185,13197)
+ PsiElement(SUB_)('sub')(13185,13188)
+ PsiWhiteSpace(' ')(13188,13189)
+ PsiTypeQLElement(type_any) - Location: (13189,13197)(13189,13197)
+ PsiTypeQLElement(type) - Location: (13189,13197)(13189,13197)
+ PsiTypeQLElement(label) - Location: (13189,13197)(13189,13197)
+ PsiTypeQLElement(type_native) - Location: (13189,13197)(13189,13197)
+ PsiElement('relation')('relation')(13189,13197)
+ PsiElement(',')(',')(13197,13198)
+ PsiWhiteSpace('\n ')(13198,13203)
+ PsiTypeQLRelatesType(type_constraint) - Name: derived-from - Location: (13203,13223)(13203,13223)
+ PsiElement('relates')('relates')(13203,13210)
+ PsiWhiteSpace(' ')(13210,13211)
+ PsiTypeQLElement(type) - Location: (13211,13223)(13211,13223)
+ PsiTypeQLElement(label) - Location: (13211,13223)(13211,13223)
+ PsiElement(LABEL_)('derived-from')(13211,13223)
+ PsiElement(',')(',')(13223,13224)
+ PsiWhiteSpace('\n ')(13224,13229)
+ PsiTypeQLRelatesType(type_constraint) - Name: deriving - Location: (13229,13245)(13229,13245)
+ PsiElement('relates')('relates')(13229,13236)
+ PsiWhiteSpace(' ')(13236,13237)
+ PsiTypeQLElement(type) - Location: (13237,13245)(13237,13245)
+ PsiTypeQLElement(label) - Location: (13237,13245)(13237,13245)
+ PsiElement(LABEL_)('deriving')(13237,13245)
+ PsiElement(';')(';')(13245,13246)
+ PsiWhiteSpace('\n\n')(13246,13248)
+ PsiTypeQLElement(definable) - Location: (13248,13304)(13248,13304)
+ PsiTypeQLStatementType(statement_type) - Location: (13248,13304)(13248,13304)
+ PsiTypeQLElement(type_any) - Location: (13248,13260)(13248,13260)
+ PsiTypeQLType(type) - Name: duplicate-of - Location: (13248,13260)(13248,13260)
+ PsiTypeQLElement(label) - Location: (13248,13260)(13248,13260)
+ PsiElement(LABEL_)('duplicate-of')(13248,13260)
+ PsiWhiteSpace(' ')(13260,13261)
+ PsiTypeQLElement(type_constraint) - Location: (13261,13273)(13261,13273)
+ PsiElement(SUB_)('sub')(13261,13264)
+ PsiWhiteSpace(' ')(13264,13265)
+ PsiTypeQLElement(type_any) - Location: (13265,13273)(13265,13273)
+ PsiTypeQLElement(type) - Location: (13265,13273)(13265,13273)
+ PsiTypeQLElement(label) - Location: (13265,13273)(13265,13273)
+ PsiTypeQLElement(type_native) - Location: (13265,13273)(13265,13273)
+ PsiElement('relation')('relation')(13265,13273)
+ PsiElement(',')(',')(13273,13274)
+ PsiWhiteSpace('\n ')(13274,13279)
+ PsiTypeQLRelatesType(type_constraint) - Name: duplicated-object - Location: (13279,13304)(13279,13304)
+ PsiElement('relates')('relates')(13279,13286)
+ PsiWhiteSpace(' ')(13286,13287)
+ PsiTypeQLElement(type) - Location: (13287,13304)(13287,13304)
+ PsiTypeQLElement(label) - Location: (13287,13304)(13287,13304)
+ PsiElement(LABEL_)('duplicated-object')(13287,13304)
+ PsiElement(';')(';')(13304,13305)
+ PsiWhiteSpace('\n\n\n')(13305,13308)
+ PsiTypeQLElement(definable) - Location: (13308,13471)(13308,13471)
+ PsiTypeQLStatementType(statement_type) - Location: (13308,13471)(13308,13471)
+ PsiTypeQLElement(type_any) - Location: (13308,13316)(13308,13316)
+ PsiTypeQLType(type) - Name: sighting - Location: (13308,13316)(13308,13316)
+ PsiTypeQLElement(label) - Location: (13308,13316)(13308,13316)
+ PsiElement(LABEL_)('sighting')(13308,13316)
+ PsiWhiteSpace(' ')(13316,13317)
+ PsiTypeQLSubType(type_constraint) - Location: (13317,13343)(13317,13343)
+ PsiElement(SUB_)('sub')(13317,13320)
+ PsiWhiteSpace(' ')(13320,13321)
+ PsiTypeQLElement(type_any) - Location: (13321,13343)(13321,13343)
+ PsiTypeQLElement(type) - Location: (13321,13343)(13321,13343)
+ PsiTypeQLElement(label) - Location: (13321,13343)(13321,13343)
+ PsiElement(LABEL_)('stix-core-relationship')(13321,13343)
+ PsiElement(',')(',')(13343,13344)
+ PsiWhiteSpace('\n ')(13344,13349)
+ PsiTypeQLOwnsType(type_constraint) - Location: (13349,13364)(13349,13364)
+ PsiElement('owns')('owns')(13349,13353)
+ PsiWhiteSpace(' ')(13353,13354)
+ PsiTypeQLElement(type) - Location: (13354,13364)(13354,13364)
+ PsiTypeQLElement(label) - Location: (13354,13364)(13354,13364)
+ PsiElement(LABEL_)('first-seen')(13354,13364)
+ PsiTypeQLElement(annotations_owns) - Location: (13364,13364)(13364,13364)
+
+ PsiElement(',')(',')(13364,13365)
+ PsiWhiteSpace('\n ')(13365,13370)
+ PsiTypeQLOwnsType(type_constraint) - Location: (13370,13384)(13370,13384)
+ PsiElement('owns')('owns')(13370,13374)
+ PsiWhiteSpace(' ')(13374,13375)
+ PsiTypeQLElement(type) - Location: (13375,13384)(13375,13384)
+ PsiTypeQLElement(label) - Location: (13375,13384)(13375,13384)
+ PsiElement(LABEL_)('last-seen')(13375,13384)
+ PsiTypeQLElement(annotations_owns) - Location: (13384,13384)(13384,13384)
+
+ PsiElement(',')(',')(13384,13385)
+ PsiWhiteSpace('\n ')(13385,13390)
+ PsiTypeQLOwnsType(type_constraint) - Location: (13390,13400)(13390,13400)
+ PsiElement('owns')('owns')(13390,13394)
+ PsiWhiteSpace(' ')(13394,13395)
+ PsiTypeQLElement(type) - Location: (13395,13400)(13395,13400)
+ PsiTypeQLElement(label) - Location: (13395,13400)(13395,13400)
+ PsiTypeQLElement(unreserved) - Location: (13395,13400)(13395,13400)
+ PsiElement('count')('count')(13395,13400)
+ PsiTypeQLElement(annotations_owns) - Location: (13400,13400)(13400,13400)
+
+ PsiElement(',')(',')(13400,13401)
+ PsiWhiteSpace('\n ')(13401,13406)
+ PsiTypeQLOwnsType(type_constraint) - Location: (13406,13418)(13406,13418)
+ PsiElement('owns')('owns')(13406,13410)
+ PsiWhiteSpace(' ')(13410,13411)
+ PsiTypeQLElement(type) - Location: (13411,13418)(13411,13418)
+ PsiTypeQLElement(label) - Location: (13411,13418)(13411,13418)
+ PsiElement(LABEL_)('summary')(13411,13418)
+ PsiTypeQLElement(annotations_owns) - Location: (13418,13418)(13418,13418)
+
+ PsiElement(',')(',')(13418,13419)
+ PsiWhiteSpace('\n\n ')(13419,13425)
+ PsiTypeQLRelatesType(type_constraint) - Name: sighting-of - Location: (13425,13444)(13425,13444)
+ PsiElement('relates')('relates')(13425,13432)
+ PsiWhiteSpace(' ')(13432,13433)
+ PsiTypeQLElement(type) - Location: (13433,13444)(13433,13444)
+ PsiTypeQLElement(label) - Location: (13433,13444)(13433,13444)
+ PsiElement(LABEL_)('sighting-of')(13433,13444)
+ PsiElement(',')(',')(13444,13445)
+ PsiWhiteSpace('\n ')(13445,13450)
+ PsiTypeQLRelatesType(type_constraint) - Name: observed-data - Location: (13450,13471)(13450,13471)
+ PsiElement('relates')('relates')(13450,13457)
+ PsiWhiteSpace(' ')(13457,13458)
+ PsiTypeQLElement(type) - Location: (13458,13471)(13458,13471)
+ PsiTypeQLElement(label) - Location: (13458,13471)(13458,13471)
+ PsiElement(LABEL_)('observed-data')(13458,13471)
+ PsiElement(';')(';')(13471,13472)
+ PsiWhiteSpace('\n\n\n\n')(13472,13476)
+ PsiComment(COMMENT)('### 6 SCOs ###\n')(13476,13491)
+ PsiWhiteSpace('\n')(13491,13492)
+ PsiTypeQLElement(definable) - Location: (13492,13795)(13492,13795)
+ PsiTypeQLStatementType(statement_type) - Location: (13492,13795)(13492,13795)
+ PsiTypeQLElement(type_any) - Location: (13492,13500)(13492,13500)
+ PsiTypeQLType(type) - Name: artifact - Location: (13492,13500)(13492,13500)
+ PsiTypeQLElement(label) - Location: (13492,13500)(13492,13500)
+ PsiElement(LABEL_)('artifact')(13492,13500)
+ PsiWhiteSpace(' ')(13500,13501)
+ PsiTypeQLSubType(type_constraint) - Location: (13501,13533)(13501,13533)
+ PsiElement(SUB_)('sub')(13501,13504)
+ PsiWhiteSpace(' ')(13504,13505)
+ PsiTypeQLElement(type_any) - Location: (13505,13533)(13505,13533)
+ PsiTypeQLElement(type) - Location: (13505,13533)(13505,13533)
+ PsiTypeQLElement(label) - Location: (13505,13533)(13505,13533)
+ PsiElement(LABEL_)('stix-cyber-observable-object')(13505,13533)
+ PsiElement(',')(',')(13533,13534)
+ PsiWhiteSpace('\n ')(13534,13539)
+ PsiTypeQLOwnsType(type_constraint) - Location: (13539,13553)(13539,13553)
+ PsiElement('owns')('owns')(13539,13543)
+ PsiWhiteSpace(' ')(13543,13544)
+ PsiTypeQLElement(type) - Location: (13544,13553)(13544,13553)
+ PsiTypeQLElement(label) - Location: (13544,13553)(13544,13553)
+ PsiElement(LABEL_)('mime-type')(13544,13553)
+ PsiTypeQLElement(annotations_owns) - Location: (13553,13553)(13553,13553)
+
+ PsiElement(',')(',')(13553,13554)
+ PsiWhiteSpace('\n ')(13554,13559)
+ PsiTypeQLOwnsType(type_constraint) - Location: (13559,13575)(13559,13575)
+ PsiElement('owns')('owns')(13559,13563)
+ PsiWhiteSpace(' ')(13563,13564)
+ PsiTypeQLElement(type) - Location: (13564,13575)(13564,13575)
+ PsiTypeQLElement(label) - Location: (13564,13575)(13564,13575)
+ PsiElement(LABEL_)('payload-bin')(13564,13575)
+ PsiTypeQLElement(annotations_owns) - Location: (13575,13575)(13575,13575)
+
+ PsiElement(',')(',')(13575,13576)
+ PsiWhiteSpace('\n ')(13576,13581)
+ PsiTypeQLOwnsType(type_constraint) - Location: (13581,13594)(13581,13594)
+ PsiElement('owns')('owns')(13581,13585)
+ PsiWhiteSpace(' ')(13585,13586)
+ PsiTypeQLElement(type) - Location: (13586,13594)(13586,13594)
+ PsiTypeQLElement(label) - Location: (13586,13594)(13586,13594)
+ PsiElement(LABEL_)('url-link')(13586,13594)
+ PsiTypeQLElement(annotations_owns) - Location: (13594,13594)(13594,13594)
+
+ PsiElement(',')(',')(13594,13595)
+ PsiWhiteSpace('\n ')(13595,13600)
+ PsiTypeQLOwnsType(type_constraint) - Location: (13600,13625)(13600,13625)
+ PsiElement('owns')('owns')(13600,13604)
+ PsiWhiteSpace(' ')(13604,13605)
+ PsiTypeQLElement(type) - Location: (13605,13625)(13605,13625)
+ PsiTypeQLElement(label) - Location: (13605,13625)(13605,13625)
+ PsiElement(LABEL_)('encryption-algorithm')(13605,13625)
+ PsiTypeQLElement(annotations_owns) - Location: (13625,13625)(13625,13625)
+