Documentation
¶
Overview ¶
Package query names the queryable properties of a model's elements and reads them from shared model semantics. Query surfaces — OSLC text, the API Query and document queries — are translated to query plans elsewhere and evaluated by internal/doc/queryexec over these readers.
Index ¶
Constants ¶
const ( // PropertyID is the element identity property. PropertyID = "@id" // PropertyType is the metamodel type property. PropertyType = "@type" // PropertyName is the effective local name property. PropertyName = "name" // PropertyDeclaredName is the explicitly declared name property. PropertyDeclaredName = "declaredName" // PropertyShortName is the effective short name property. PropertyShortName = "shortName" // PropertyDeclaredShortName is the explicitly declared short name property. PropertyDeclaredShortName = "declaredShortName" // PropertyDocumentation is the body text of each `doc` comment, in order. PropertyDocumentation = "documentation" // PropertyTextualRepresentation is the body text of each `rep` the element // owns, in order (Element::textualRepresentation). PropertyTextualRepresentation = "textualRepresentation" // PropertyBody is the exact body of a `comment`, `doc` or `rep` element // itself (Comment::body, TextualRepresentation::body). PropertyBody = "body" // PropertyLocale is Comment::locale of a `comment` or `doc` declaring one. PropertyLocale = "locale" // PropertyLanguage is TextualRepresentation::language of a `rep`. PropertyLanguage = "language" // PropertyQualifiedName is the fully qualified name property. PropertyQualifiedName = "qualifiedName" // PropertyOwner is the owning element's qualified name property. PropertyOwner = "owner" // PropertyElementType is the resolved declared element type property. PropertyElementType = "type" // PropertyGeneral is the types a definition specializes or a usage is typed by, // in declaration order. PropertyGeneral = "general" // PropertyIsAbstract is the abstractness property. PropertyIsAbstract = "isAbstract" // PropertyIsIndividual is the `individual` modifier of a definition or usage. PropertyIsIndividual = "isIndividual" // PropertyMultiplicityLower is the lower multiplicity bound property. PropertyMultiplicityLower = "multiplicityLower" // PropertyMultiplicityUpper is the upper multiplicity bound property. PropertyMultiplicityUpper = "multiplicityUpper" // PropertySatisfiedRequirement is the requirement a satisfy usage satisfies. PropertySatisfiedRequirement = "satisfiedRequirement" // PropertySatisfyingFeature is the feature a satisfy usage is by. PropertySatisfyingFeature = "satisfyingFeature" // PropertyVerifiedRequirement is the requirement an objective's `verify` verifies. PropertyVerifiedRequirement = "verifiedRequirement" // PropertyVerifyingCase is the verification case whose objective holds a `verify`. PropertyVerifyingCase = "verifyingCase" // PropertyPayloadArgument, PropertySenderArgument and PropertyReceiverArgument // are the arguments of a send action as written: what it sends, the `via` // sender and the `to` receiver (SysML v2 §8.3.17.15 SendActionUsage). PropertyPayloadArgument = "payloadArgument" PropertySenderArgument = "senderArgument" PropertyReceiverArgument = "receiverArgument" // PropertySymbolKind is the kind of the element's symbol, as SymbolInfo.kind // spells it ("partDef", "stateUsage"). PropertySymbolKind = "symbolKind" // PropertyText is RequirementDefinition::text / RequirementUsage::text: the // body of each `doc` the requirement owns, in order. PropertyText = "text" // PropertyElementID is the elementId a conversion of the model writes for // the element, reported only where the reader is given one (WithElementID). PropertyElementID = "elementId" )
Variables ¶
This section is empty.
Functions ¶
func IsMetamodelTypeName ¶
IsMetamodelTypeName reports whether some element can report name as its @type.
func MetamodelTypeName ¶
func MetamodelTypeName(kind symbols.SymbolKind) string
MetamodelTypeName returns the metamodel type associated with a symbol kind.
func MetamodelTypeNameOf ¶
MetamodelTypeNameOf returns the metamodel type name an element reports as @type, refining symbol kinds that span several metaclasses.
func PropertyNames ¶
func PropertyNames() []string
PropertyNames returns the supported property names in stable order.
Types ¶
type PropertyReader ¶
type PropertyReader struct {
// contains filtered or unexported fields
}
PropertyReader reads queryable properties from shared model semantics.
func NewPropertyReader ¶
func NewPropertyReader(index *symbols.Index, resolver *resolve.Resolver, model *semantics.Model) *PropertyReader
NewPropertyReader constructs a reader over one index and semantic model.
func (*PropertyReader) WithElementID ¶ added in v0.9.2
func (r *PropertyReader) WithElementID(elementID func(*symbols.Symbol) string) *PropertyReader
WithElementID sets how an element's elementId is read: the id a conversion of the model writes for it. Without one, elementId is absent.
func (*PropertyReader) WithIdentity ¶ added in v0.9.2
func (r *PropertyReader) WithIdentity(identity func(*symbols.Symbol) string) *PropertyReader
WithIdentity overrides how element identities are reported by this reader.