package ontology
This package contains a relational ontology and a query engine for it.
The main classes are: - RelationalElement defines the concepts and relation of the ontology (TBox) - RelationalManager extracts the ABox from MMT content - RelStore maintains the model of the ontology (ABox) - RelationGraphExporter allows exporting the ABox as a graph. - Query defines a query language for the ontology - Evaluator implements the query language for a given ABox. - Search maintains classes for faceted search, in particular the facet for MathWebSearch.
- Source
- package.scala
- Alphabetic
- By Inheritance
- ontology
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- class AddAlignments extends Extension
- sealed abstract class Alignment extends AnyRef
- case class AlignmentConcatenation(first: FormalAlignment, second: FormalAlignment) extends FormalAlignment with Product with Serializable
- class AlignmentsServer extends ServerExtension
-
class
Analyze extends QueryFunctionExtension
type reconstruction of objects
-
case class
And(left: Prop, right: Prop) extends Prop with Product with Serializable
conjunction
-
abstract
class
Annotation extends AnyRef
an annotation returned by an AnnotationProvider, to be used by e.g.
an annotation returned by an AnnotationProvider, to be used by e.g. MMTGutterAnnotations
-
abstract
class
AnnotationProvider extends Extension
provides additional information about MMT elements (e.g., compilation warnings, refactoring suggestions, discussion pointers)
- case class ArgumentAlignment(from: LogicalReference, to: LogicalReference, invertible: Boolean, arguments: List[(Int, Int)]) extends FormalAlignment with Product with Serializable
-
trait
BaseType extends AnyRef
a trait for all concrete data types that can be returned by queries; atomic types are paths and objects
-
case class
BigUnion(domain: Query, varname: LocalName, of: Query) extends Query with Product with Serializable
union of a collection of sets indexed by a set
-
sealed abstract
class
Binary extends AnyRef
An object of type Binary represents a binary predicate between MMT paths in the MMT ontology.
An object of type Binary represents a binary predicate between MMT paths in the MMT ontology. The semantics of these objects is given by their name
- abstract class BinaryQueryJudgement extends QueryJudgement
-
case class
Bound(varname: LocalName) extends Query with Product with Serializable
bound variable represented by a info.kwarc.mmt.api.LocalName
-
case class
Choice(qs: RelationExp*) extends RelationExp with Product with Serializable
the union of a list of relations
-
case class
Closure(of: Query) extends Query with Product with Serializable
dependency closure of a path
-
case class
Component(of: Query, component: ComponentKey) extends Query with Product with Serializable
component of all elements inside a query
-
case class
Comprehension(domain: Query, varname: LocalName, pred: Prop) extends Query with Product with Serializable
comprehension subset of a set
- case class ConceptAlignment extends Alignment with Product with Serializable
- case class ConceptPair(from: ConceptReference, to: ConceptReference) extends Alignment with Product with Serializable
-
case class
ConceptReference(con: String) extends Reference with CanonicalForm[ConceptReference] with Product with Serializable
general concepts
-
case class
CustomBinary(name: String, desc: String, backwardsDesc: String) extends Binary with Product with Serializable
Extractor extensions should use instances of this class to extend the ontology for binary relations
-
case class
CustomUnary(name: String) extends Unary with Product with Serializable
Extractor extensions should use instances of this class to extend the ontology for unary relations
- class DeclarationTreeExporter extends SimpleRelationGraphExporter
- class DependencyGraphExporter extends SimpleRelationGraphExporter
-
case class
DereferenceAlignment(fromP: ContentPath, toP: ContentPath, dotOperator: GlobalName) extends FormalAlignment with Product with Serializable
aligns a global function with a method that is accessed via projection on the first argument
-
case class
Difference(of: Query, without: Query) extends Query with Product with Serializable
difference of sets
-
sealed abstract
class
Edge extends AnyRef
types of edges in a theory multigraph; edges may have an id; there may be at most one edge without id between two nodes
-
case class
EdgeTo(to: Path, edge: Edge, backwards: Boolean = false) extends Product with Serializable
an edge together with its end point, optionally may be backwards
-
case class
ElemResult(t: List[BaseType]) extends QueryResult with Product with Serializable
The results of an Element Query: A Tuple of [BaseType]s.
The results of an Element Query: A Tuple of [BaseType]s.
- t
Tuple of BaseType Results
-
case class
Element(q: Query, index: Int) extends Query with Product with Serializable
takes a specific element from a querySet (negative indexes work also)
-
case class
ElementQuery(tp: List[QueryBaseType]) extends QueryType with Product with Serializable
a single tuple of base types
-
case class
Equal(left: Query, right: Query) extends Prop with Product with Serializable
equality of elements
-
case class
Equals(varname: LocalName, left: Term, right: Term) extends BinaryQueryJudgement with Product with Serializable
semantic equality between two terms
-
case class
Forall(domain: Query, varname: LocalName, scope: Prop) extends Prop with Product with Serializable
universal quantification over a set
- sealed abstract class FormalAlignment extends URIAlignment
-
case class
HasType(mustHave: Option[List[Unary]], mustNotHave: List[Unary]) extends RelationExp with Product with Serializable
the reflexive relation restricted to a set of paths This permits the restriction of a result set to, e.g., elements of a certain type.
-
case class
Holds(about: Query, j: QueryJudgement) extends Prop with Product with Serializable
judgement that holds for a single element
-
case class
I(q: Query, hint: Option[String]) extends Query with Product with Serializable
isolated sub-query of a query.
isolated sub-query of a query. Carries an optional hint on how to evaluate the query
-
case class
Individual(path: Path, tp: Unary) extends RelationalElement with Product with Serializable
An object of type Individual represents a unary predicate in the ABox.
-
class
Infer extends QueryFunctionExtension
type inference relative to a theory
- case class InformalAlignment(from: URIReference, to: URIReference) extends URIAlignment with Product with Serializable
-
case class
Intersection(left: Query, right: Query) extends Query with Product with Serializable
intersection of sets
-
case class
IsA(e: Query, t: Unary) extends Prop with Product with Serializable
typing relation between a path and a concept of the MMT ontology
-
case class
IsEmpty(r: Query) extends Prop with Product with Serializable
emptiness of a set
-
case class
IsIn(elem: Query, tp: Query) extends Prop with Product with Serializable
element relation between elements and sets
-
case class
Let(varname: LocalName, value: Query, in: Query) extends Query with Product with Serializable
let binder
-
case class
Literal[T <: BaseType](literal: T) extends Query with Product with Serializable
literal
-
case class
Literals[T <: BaseType](literals: T*) extends Query with Product with Serializable
set of literals
-
case class
LogicalReference(mmturi: ContentPath) extends URIReference with Product with Serializable
MMT objects
-
case class
Mapping(domain: Query, varname: LocalName, function: Term) extends Query with Product with Serializable
apply a term to an existing set
-
class
MathWebSearch extends Extension
abstraction that wraps around a remote MathWebSearch server
-
case class
MathWebSearchQuery(pattern: TermPattern, answsize: Int = 1000, limitmin: Int = 0) extends Product with Serializable
a query to be sent to a MathWebSearch
-
case class
Measure(value: Int) extends Product with Serializable
similarity measure; for now integers
-
case class
Not(arg: Prop) extends Prop with Product with Serializable
negation
-
class
Parse extends QueryFunctionExtension
parsing of strings into objects
- class PathGraphExporter extends RelationGraphExporter
-
case class
PathPattern(basePattern: Option[String], modulePattern: Option[String], namePattern: Option[String]) extends Product with Serializable
regular expressions to be matched against components of a Path
-
case class
Paths(tp: Unary) extends Query with Product with Serializable
the set of all URIs of a certain concept in the MMT ontology
-
case class
PhysicalReference(url: URI) extends URIReference with Product with Serializable
external objects
-
case class
PrefixOf(short: Query, long: Query) extends Prop with Product with Serializable
ancestor relation between paths
-
class
Present extends QueryFunctionExtension
XML rendering of objects
-
class
PresentDecl extends QueryFunctionExtension
XML rendering of declarations
-
case class
Projection(of: Query, index: Int) extends Query with Product with Serializable
projection
projection
- index
the component to project out (starting from 1)
-
sealed abstract
class
Prop extends AnyRef
propositions
-
sealed abstract
class
Query extends AnyRef
the expressions of the query language
-
sealed abstract
class
QueryBaseType extends AnyRef
QueryBaseType = Path | Obj | XML | String
-
class
QueryEvaluator extends AnyRef
evaluates a query expression to a query result
-
abstract
class
QueryExtension extends Extension
Extension that allow for the evaluation of (a subset of) queries
-
case class
QueryFunctionApply(function: QueryFunctionExtension, argument: Query, params: List[String]) extends Query with Product with Serializable
query that applies an atomic function
-
abstract
class
QueryFunctionExtension extends QueryExtension
A QueryFunctionExtension provides the syntax and and semantics for an atomic function of the QMT query language
A QueryFunctionExtension provides the syntax and and semantics for an atomic function of the QMT query language
All functions are unary from one BaseType to another. All are actually families of functions, parametrized by an MPath.
-
sealed abstract
class
QueryJudgement extends AnyRef
A Judgement that MMT evaluates in a dynamic fashion at runtime.
A Judgement that MMT evaluates in a dynamic fashion at runtime. Receives a single GlobalName as an argument
-
sealed abstract
class
QueryResult extends AnyRef
Wrapper type for the result of a query
-
sealed abstract
class
QueryType extends AnyRef
The different types of return Values of Queries
-
sealed abstract
class
Reference extends AnyRef
any named object that can be subject to alignment
-
class
RelStore extends RelStoreStatistics
An ABoxStore stores the abox of the loaded elements with respect to the MMT ontology.
An ABoxStore stores the abox of the loaded elements with respect to the MMT ontology.
Triples (subject, binary, object) are hashed three ways so that for any two components the set of third components can be retrieved efficiently.
Use TheoryGraph for theory graph-level querying
-
trait
RelStoreStatistics extends AnyRef
generates statistics for the RelStore
-
case class
Related(to: Query, by: RelationExp) extends Query with Product with Serializable
the set of all elements related to a certain path by a certain relation
-
case class
Relation(dep: Binary, subj: Path, obj: Path) extends RelationalElement with Product with Serializable
An object of type Relation represents a binary predicate in the ABox.
An object of type Relation represents a binary predicate in the ABox. The path of a Relation is always the knowledge item reading which produced the Relation.
-
sealed abstract
class
RelationExp extends AnyRef
binary relations between paths, i.e., relation in the MMT ontology
binary relations between paths, i.e., relation in the MMT ontology
The semantics of a RelationExp is a binary relation on Paths with the usual operations for the calculus of binary endorelations. For example,
val relstore:RelStore val doc: DPath val deps = relstore.querySet(doc, +Declares * HasType(IsTheory) * (Imports | Reflexive) * -Declares)
could be used as a dependency relation between documents.
-
abstract
class
RelationGraphExporter extends BuildTarget with StructurePresenter
builds a graph from relational and then calls dot to produce an svg file
-
abstract
class
RelationalElement extends AnyRef
A RelationalElement is any element that is used in the relational representation of MMT content.
A RelationalElement is any element that is used in the relational representation of MMT content. These include the unary and binary predicates occurring in an MMT ABox. They do not correspond to XML elements in an OMDoc element and thus do not extend StructuralElement.
-
abstract
class
RelationalExtractor extends Extension
interface of any class that can be used by the RelationalManager to build the Abox from MMT content.
- class RelationalManager extends AnyRef
-
class
RelationalReader extends ArchiveChangeListener
a change listener that guarantees that relational is read for all archives
- class ResultSet extends HashSet[List[BaseType]]
-
class
Search extends AnyRef
an implementation of a search algorithm that calls MathWebSearch and filters the results
-
case class
SearchQuery(pp: PathPattern, comps: List[ComponentKey], pattern: Option[TermPattern]) extends Product with Serializable
a query that can be sent to Search
-
case class
SearchResult(cpath: CPath, pos: Position, term: Option[Term]) extends Product with Serializable
a result returned by Search or MathWebSearch
-
case class
Sequence(qs: RelationExp*) extends RelationExp with Product with Serializable
the composition of a list of relations
-
case class
SetQuery(tp: List[QueryBaseType]) extends QueryType with Product with Serializable
a set of tuples
-
case class
SetResult(s: HashSet[ElemResult]) extends QueryResult with Product with Serializable
The result of a Set Query; A set of ElementResults.
The result of a Set Query; A set of ElementResults.
- s
Set of ElemResults
- class Similarity extends AnyRef
- case class SimpleAlignment(from: LogicalReference, to: LogicalReference, invertible: Boolean) extends FormalAlignment with Product with Serializable
-
class
SimpleRelationGraphExporter extends RelationGraphExporter
builds a graph containing all nodes and edges of the types
-
class
Simplify extends QueryFunctionExtension
simplification of objects
-
case class
Singleton(e: Query) extends Query with Product with Serializable
singleton sets
-
case class
Slice(q: Query, from: Option[Int], to: Option[Int]) extends Query with Product with Serializable
take a subset of the query
-
sealed abstract
class
StatEntryType extends AnyRef
the type of a single statistics entry
-
sealed abstract
class
StatPrefixType extends AnyRef
the overall type of statistics generated
-
case class
StatisticEntry(stat: StatEntryType, n: Int) extends Product with Serializable
a single generated statistics entry
-
case class
Statistics(entries: Map[StatPrefixType, List[StatisticEntry]]) extends Product with Serializable
statistics that are being returned
- class StatisticsExporter extends BuildTarget with Exporter
- case class StringValue(string: String) extends BaseType with Product with Serializable
-
case class
StructureEdge(id: Path) extends Edge with Product with Serializable
named import
-
case class
SubObject(of: Query, position: Position) extends Query with Product with Serializable
subobject of an object at a certain position
-
case class
TermPattern(qvars: Context, query: Term) extends Product with Serializable
a pattern to be matched against a collection of terms, e.g., via MathWebSearch
-
class
TheoryGraph extends AnyRef
This class adds advanced queries on top of a RelStore that expose the theory graph structure
-
class
TheoryGraphExporter extends RelationGraphExporter
uses ontology.TheoryGraphFragment to produce a dot file and then calls dot to produce an svg file
-
class
TheoryGraphFragment extends AnyRef
This class provides functions for rendering a theory graph fragment in the gexf and dot graph formats.
-
case class
ToObject(dep: Binary) extends RelationExp with Product with Serializable
base case: an atomic binary relation
-
case class
ToSubject(dep: Binary) extends RelationExp with Product with Serializable
base case: the inverse of an atomic binary relation
-
case class
Transitive(q: RelationExp) extends RelationExp with Product with Serializable
the transitive closure of a relation
-
case class
Tuple(components: List[Query]) extends Query with Product with Serializable
tupling
-
case class
Types(varname: LocalName, left: Term, right: Term) extends BinaryQueryJudgement with Product with Serializable
semantic type of a term
- sealed abstract class URIAlignment extends Alignment
-
sealed abstract
class
URIReference extends Reference
objects that have URIs
-
sealed abstract
class
Unary extends AnyRef
An object of type Unary represents a unary predicate on MMT paths in the MMT ontology.
An object of type Unary represents a unary predicate on MMT paths in the MMT ontology. The semantics of these objects is given by their name
-
case class
Union(left: Query, right: Query) extends Query with Product with Serializable
union of sets
-
case class
ViewEdge(id: Path) extends Edge with Product with Serializable
named view
- case class XMLValue(node: Node) extends BaseType with Product with Serializable
Value Members
- object AlignmentPrefix extends StatPrefixType with Product with Serializable
- object AlignmentsServer
- object AnyMorphismEntry extends StatEntryType with Product with Serializable
- object AnyMorphismPrefix extends StatPrefixType with Product with Serializable
- object AnyOtherEntry extends StatEntryType with Product with Serializable
- object ArgumentAlignment extends Serializable
- object BaseType
- object Binary
- object ConceptAlignment extends Serializable
- object ConceptPair extends Serializable
- object DataConstructorEntry extends StatEntryType with Product with Serializable
- object DatatypeConstructorEntry extends StatEntryType with Product with Serializable
- object Declares extends Binary with Product with Serializable
- object DependsOn extends Binary with Product with Serializable
- object DocumentEntry extends StatEntryType with Product with Serializable
- object ElementQuery extends Serializable
-
object
ElementQuery1
a single basetype
-
object
Exists
existential quantification over a set
- object ExplicitMorphismEntry extends StatEntryType with Product with Serializable
- object ExplicitMorphismPrefix extends StatPrefixType with Product with Serializable
- object HasCodomain extends Binary with Product with Serializable
- object HasDomain extends Binary with Product with Serializable
- object HasMeta extends Binary with Product with Serializable
- object HasType extends Serializable
- object HasViewFrom extends Binary with Product with Serializable
- object HighUniverseEntry extends StatEntryType with Product with Serializable
-
object
IncludeEdge extends Edge with Product with Serializable
inclusion edge
- object Includes extends Binary with Product with Serializable
- object InformalAlignment extends Serializable
- object IsAliasFor extends Binary with Product with Serializable
- object IsAlignedWith extends Binary with Product with Serializable
- object IsConAss extends Unary with Product with Serializable
- object IsConstant extends Unary with Product with Serializable
- object IsDataConstructor extends Unary with Product with Serializable
- object IsDatatypeConstructor extends Unary with Product with Serializable
- object IsDerivedDeclaration extends Unary with Product with Serializable
- object IsDocument extends Unary with Product with Serializable
- object IsHighUniverse extends Unary with Product with Serializable
- object IsImplicitly extends Binary with Product with Serializable
- object IsInstance extends Unary with Product with Serializable
- object IsInstanceOf extends Binary with Product with Serializable
- object IsJudgementConstructor extends Unary with Product with Serializable
- object IsNotation extends Unary with Product with Serializable
- object IsPattern extends Unary with Product with Serializable
- object IsRule extends Unary with Product with Serializable
- object IsStrAss extends Unary with Product with Serializable
- object IsStructure extends Unary with Product with Serializable
- object IsTheory extends Unary with Product with Serializable
- object IsUntypedConstant extends Unary with Product with Serializable
- object IsView extends Unary with Product with Serializable
- object JudgementConstructorEntry extends StatEntryType with Product with Serializable
-
object
MMTExtractor extends RelationalExtractor
The Extractor produces the declaration-level relational representation of a StructuralElement
- object MaltypedConstantEntry extends StatEntryType with Product with Serializable
-
object
MetaEdge extends Edge with Product with Serializable
meta-theory edge
- object NoPrefix extends StatPrefixType with Product with Serializable
- object ObjType extends QueryBaseType with Product with Serializable
-
object
Or
disjunction
- object PathType extends QueryBaseType with Product with Serializable
- object PatternEntry extends StatEntryType with Product with Serializable
- object Prop
- object QMTBinaries
- object QMTJudgements
- object QMTPaths
- object QMTProp
- object QMTQuery
- object QMTRelationExp
- object QMTTypes
- object QMTUnaries
- object Query
- object QueryChecker
- object QueryEvaluator
- object QueryJudgement
- object QueryResultConversion
- object QueryType
-
object
QueryTypeConversion
implicit conversions from / to Query types
- object RefersTo extends Binary with Product with Serializable
-
object
Reflexive extends RelationExp with Product with Serializable
the reflexive relation
-
object
RelationExp
helper object for relation expressions
- object ResultSet extends Serializable
- object RuleEntry extends StatEntryType with Product with Serializable
- object SetQuery extends Serializable
-
object
SetQuery1
a set of single base types
- object SimpleAlignment extends Serializable
- object StatEntryType
- object StatPrefixType
- object StringType extends QueryBaseType with Product with Serializable
- object StructureEntry extends StatEntryType with Product with Serializable
-
object
Symmetric
the symmetric closure of a relation
- object TermPattern extends Serializable
- object TheoryEntry extends StatEntryType with Product with Serializable
- object TypedConstantEntry extends StatEntryType with Product with Serializable
- object Unary
- object UntypedConstantEntry extends StatEntryType with Product with Serializable
- object ViewEntry extends StatEntryType with Product with Serializable
- object XMLType extends QueryBaseType with Product with Serializable