-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Before talking about the CycDAG, the details of the core DAG should be read through first. Please read the details of the DagYo project first.
The biggest change to DagYo is the ability to nest functions within edges (basically edges within edges). Functions are interpreted as both nodes and edges, though they are internally stored as nodes. A function is written as ( ...), where the first node should be a Function. Each function represents an entity, as with other nodes, but the entity is specified as a function of other entities. E.g. (FruitFn AppleTree) essentially defines the collection of Apples (the fruit of an apple tree).
The Ontology extension uses the same commands, though some have altered behaviour (and so are relisted here). As at 8/8/2013.
- addedge - Creates and adds a new edge to the DAG.
Adds an edge as before, but treats the edge as named. The first argument must be a Predicate, which is used to define the constraints applied to the remaining edge arguments. Firstly, the arity (number of arguments) of the predicate is defined. Secondly, the semantic argument constraints define what types of arguments are allowed in the edge. When the edge is created, the argument constraints are checked to ensure the arguments of the edge fit these constraints (using the resultIsa and resultGenl values for functions).
- dagtotext - Produces a NLP description of a node, edge, or query.
This command represents a node, edge, or query in a natural language format. Nodes/concepts use the prettyString-Canonical/termStrings/basic CamelCase parsing. Edges and queries are similarly represented as 'X has relation P to Y' or 'X is nlp(P) Y' where applicable. The output can be improved by using the following assertions:
prettyString-canonical: e.g. (prettyString-Canonical SamuelLJackson "Samuel L. Jackson")
nlpPredicateString: e.g. (nlpPredicateString isa "an instance of"), that is, "X is [nlpPredicateString] Y"
_ReversedNLPStringPredicate", e.g. (quotedIsa broaderTerm ReversedNLPStringPredicate), this indicates that any NLP string should swap X and Y due to the ordering of the predicate (e.g. (broaderTerm GeorgeWBush Texas-State) needs to state that "Texas (state) is broader than George W. Bush".
- depthnodes - Returns all nodes of a certain depth (where Thing is at depth 0).
This requires the DepthModule to compute the depths of the nodes.
- extract - Extracts the values of variable substitutions from a command's output.
Basically converts a substitution mapping of results into a simple list of results. Mainly used for combining query and non-query-based commands.
- extractsubdag - Extracts a subset of the ontology and saves it to file.
This performs a more extensive extraction using transitive edges to follow the structure of the ontology. That is, if X and Y are present in the subDAG, all assertions concerning X and Y are also present in the subDAG, including transitive assertions such as disjointness. A full explanation of the process can be found at SubDAG Extraction.
- findedges - Returns all edges that utilise the node arguments.
Has been slightly modified to allow for searching within functions. Instead of a single integer position, a slightly more complex grammar is used, in which function depth is encoded. Position must match 'i(Fj)*' (where i and j represent one or more integers), which states: recurse into the function at position i and return the argument at position j.
For example, '1F2F0' would return the first argument (remember, 0-based indexing) of the function nested in the third argument of the second argument of the edge. E.g. It would return for the edge '(A (B C (D E)) F)', argument D.
- findnodes - Finds all nodes by their name/alias.
Same as with the DAG, but also with the capability to parse Dates in a variety of formats (sometimes returning multiple dates when the format is ambiguous).
- findnodes* - Finds all nodes that match a string and satisfy a query.
Performs the same node search as findnodes, but also uses a query to filter the results such that only those that satisfy the query remain. Use ?X where the found node will be substituted in the query.
- function - Returns the extent of a function's use.
Returns all NART/NAUTs utilising the provided function to define the concept.
- groundephemeral - Grounds ephemeral nodes and edges, then rebuilds and saves modules.
The ground ephemeral operation is as normal, but imposes a sort order of ascending depth (such that higher level nodes are grounded first).
- justify - Returns the justification for why a query is true.
Justify provides the shortest linkage of direct assertions that justify how a query is true. The syntax for justify is the same as for query. Justify can only prove direct proofs and only with genls, isa, disjointWith so far, but more functionality coming soon.
- microtheory - Returns all nodes using a particular microtheory.
Returns all nodes using a given microtheory. This is not transitive - just a property map. Microtheories aren't used for reasoning (yet), but they can act as identifiers.
- query - Poses a query to the DAG which returns a variable substitution map.
Query is a new command, typed as query ( ...) which infers over the set of edges using transitivity and other rules to return results. Queries may optionally use variable nodes instead of nodes. A variable node is written as '?\w+'. When used in a query, variable nodes return all known and inferrable edges which match the variable value. Each node may also be a function, which in turn can also contain variable nodes.
If no variable nodes are used, a query either returns NIL (the queried edge cannot be inferred), or an empty set of results (the queried edge can be inferred).
- query* - Poses a query to the DAG which returns a variable substitution map.
Performs a more complex query with simplified syntax. Also, some queries that are impossible to run without quantifiers are processed here in code. Quick queries include: ALIAS, ALLGENLS, ALLISA, ARGNGENL, ARGNISA, COMMENT, DIRECTGENLS, DIRECTINSTANCE, DIRECTISA, DIRECTSPECS, DISJOINT, GENLSIBLINGS, GENLPREDS, INSTANCES, ISASIBLINGS, MAXINSTANCES, MAXSPECS, MINARGNGENL, MINARGNISA, MINGENLS, MINISA, SPECPREDS, SPECS.
- removeall - Removes the output of one command from the output of another command.
Like the intersect/union commands, but removes the output of one command from another command's output (via string replacement).
- semsiblings - Returns all siblings of a collection ordered by semantic similarity.
Returns all siblings of a collection ordered by semantic similarity. If any sort order is imposed, this command is the same as a query* SIBLINGS command.
- similarity - Calculates the semantic similarity between two concepts.
Calculates the similarity between concept1 and concept2, where a similarity of 1 = identical, and similarity 0 = completely disconnected.
Some statistics about the ontology in the basic OpenCyc. Technically an analysis of OpenCyc, but the DAG is easier to use for this purpose.
- Number of nodes: 241739 (includes reifiable functions)
- Number of Constants: X
- Number of Constant Individuals: Y
- Number of Constant Collections: Y
- Number of Constant Functions: Y
- Number of Constant Predicates: Y
- Number of NARTs: X
- Number of NART Individuals: Y
- Number of NART Collections: Y
- Number of NART Functions: Y
- Number of NART Predicates: Y
- Number of edges: 1833771
- Number of isa edges: X
- Number of genls edges: X
- Number of genlPreds edges: X
- Number of prettyString(-Canonical) edges: X
Top 20 utilised relations List: Freq