query

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func IsMetamodelTypeName(name string) bool

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

func MetamodelTypeNameOf(sym *symbols.Symbol) string

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.

func QualifiedIdentity added in v0.9.2

func QualifiedIdentity(index *symbols.Index, sym *symbols.Symbol) string

QualifiedIdentity returns the qualified name that identifies sym in index.

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) Values

func (r *PropertyReader) Values(sym *symbols.Symbol, property string) ([]string, bool)

Values returns the values of one queryable property.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL