From 13579de052a7ec397c7810ac30fbad4a032b324e Mon Sep 17 00:00:00 2001 From: Iddan Aaronsohn Date: Fri, 13 Dec 2019 12:40:30 +0200 Subject: [PATCH] linkedql: Add comment to path methods --- linkedql.json | 2118 ++++++++++++++++--------------- query/linkedql/client/client.go | 60 +- 2 files changed, 1094 insertions(+), 1084 deletions(-) diff --git a/linkedql.json b/linkedql.json index bfc4f8d8c..db07f5113 100644 --- a/linkedql.json +++ b/linkedql.json @@ -1,1056 +1,1066 @@ { - "@context": { - "rdf": { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#" }, - "rdfs": { "@id": "http://www.w3.org/2000/01/rdf-schema#" }, - "owl": { "@id": "http://www.w3.org/2002/07/owl#" }, - "xsd": { "@id": "http://www.w3.org/2001/XMLSchema#" }, - "linkedql": { "@id": "http://cayley.io/linkedql#" } - }, - "@graph": [ - { - "@id": "linkedql:Limit", - "@type": "rdfs:Class", - "rdfs:comment": "Limit a number of nodes for current path.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n8440732519379756303", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n3712322762825274014", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:limit" - } - } - ] - }, - { - "@id": "linkedql:Value", - "@type": "rdfs:Class", - "rdfs:comment": "Value returns a single value matched in the query", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n4579355384285360119", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Intersect", - "@type": "rdfs:Class", - "rdfs:comment": "Intersect resolves to all the same values resolved by the from step and the provided steps.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n4514190024430663212", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:ReversePropertyNames", - "@type": "rdfs:Class", - "rdfs:comment": "Get the list of predicates that are pointing in to a node.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n8660593491344506672", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Labels", - "@type": "rdfs:Class", - "rdfs:comment": "Get the list of inbound and outbound quad labels", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n3966336922519947481", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Order", - "@type": "rdfs:Class", - "rdfs:comment": "Order sorts the results in ascending order according to the current entity / value", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n6687051227661129038", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:SelectFirst", - "@type": "rdfs:Class", - "rdfs:comment": "Like Select but only returns the first result", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n8213583569693444697", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Out", - "@type": "rdfs:Class", - "rdfs:comment": "Alias for View", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n1219656053828715988", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n2330159957297390889", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:properties" - } - } - ] - }, - { - "@id": "linkedql:In", - "@type": "rdfs:Class", - "rdfs:comment": "Alias for ViewReverse", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n888163984235468022", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n6694906304984451453", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:properties" - } - } - ] - }, - { - "@id": "linkedql:Has", - "@type": "rdfs:Class", - "rdfs:comment": "Filter all paths which are, at this point, on the subject for the given predicate and object, but do not follow the path, merely filter the possible paths. Usually useful for starting with all nodes, or limiting to a subset depending on some predicate/value pair.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n175100899574574219", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n1044889261799882442", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:property" - } - } - ] - }, - { - "@id": "linkedql:PropertyNamesAs", - "@type": "rdfs:Class", - "rdfs:comment": "Tag the list of predicates that are pointing out from a node.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n292297794499813908", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n6225281244837245777", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:tag" - } - } - ] - }, - { - "@id": "linkedql:Skip", - "@type": "rdfs:Class", - "rdfs:comment": "Skip a number of nodes for current path.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n130022202379099635", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n6588229958767122733", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:offset" - } - } - ] - }, - { - "@id": "linkedql:Vertex", - "@type": "rdfs:Class", - "rdfs:comment": "Vertex resolves to all the existing objects and primitive values in the graph. If provided with values resolves to a sublist of all the existing values in the graph.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - } - ] - }, - { - "@id": "linkedql:As", - "@type": "rdfs:Class", - "rdfs:comment": "As assigns the resolved values of the from step to a given name. The name can be used with the Select and Documents steps to retreive the values or to return to the values in further steps with the Back step. It resolves to the values of the from step.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n6798046550741287208", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n286452450666657184", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:name" - } - } - ] - }, - { - "@id": "linkedql:FollowReverse", - "@type": "rdfs:Class", - "rdfs:comment": "The same as follow but follows the chain in the reverse direction. Flips View and ViewReverse where appropriate, the net result being a virtual predicate followed in the reverse direction. Starts at the end of the morphism and follows it backwards (with appropriate flipped directions) to the g.M() location.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n421149569477813134", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n8713908741985514185", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:followed" - } - } - ] - }, - { - "@id": "linkedql:Back", - "@type": "rdfs:Class", - "rdfs:comment": "Back resolves to the values of the previous the step or the values assigned to name in a former step.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n6224931844063977691", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n7828451043486737760", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:name" - } - } - ] - }, - { - "@id": "linkedql:ViewBoth", - "@type": "rdfs:Class", - "rdfs:comment": "ViewBoth is like View but resolves to both the object values and references to the values of the given properties in via. It is the equivalent for the Union of View and ViewReverse of the same property.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n5094381124248830937", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n3925447844365248023", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:properties" - } - } - ] - }, - { - "@id": "linkedql:Unique", - "@type": "rdfs:Class", - "rdfs:comment": "Remove duplicate values from the path.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n5542740196010578693", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Count", - "@type": "rdfs:Class", - "rdfs:comment": "Count resolves to the number of the resolved values of the from step", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n3865310955534739904", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:ViewReverse", - "@type": "rdfs:Class", - "rdfs:comment": "The inverse of View. Starting with the nodes in `path` on the object, follow the quads with predicates defined by `predicatePath` to their subjects.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n5018575002663944481", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n4550818690762018934", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:properties" - } - } - ] - }, - { - "@id": "linkedql:Properties", - "@type": "rdfs:Class", - "rdfs:comment": "Adds tags for all properties of the current entity", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n2729739665710486886", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:HasReverse", - "@type": "rdfs:Class", - "rdfs:comment": "The same as Has, but sets constraint in reverse direction.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n7199307538045442194", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n1649650420342137981", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:property" - } - } - ] - }, - { - "@id": "linkedql:ReversePropertyNamesAs", - "@type": "rdfs:Class", - "rdfs:comment": "Tag the list of predicates that are pointing in to a node.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n824169249890386973", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n912081101491472970", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:tag" - } - } - ] - }, - { - "@id": "linkedql:Union", - "@type": "rdfs:Class", - "rdfs:comment": "Return the combined paths of the two queries. Notice that it's per-path, not per-node. Once again, if multiple paths reach the same destination, they might have had different ways of getting there (and different tags).", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n8251106634341539663", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Placeholder", - "@type": "rdfs:Class", - "rdfs:comment": "Placeholder is like Vertex but resolves to the values in the context it is placed in. It should only be used where a PathStep is expected and can't be resolved on its own.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - } - ] - }, - { - "@id": "linkedql:View", - "@type": "rdfs:Class", - "rdfs:comment": "View resolves to the values of the given property or properties in via of the current objects. If via is a path it's resolved values will be used as properties.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n5414025948682150736", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n337958186940316772", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:properties" - } - } - ] - }, - { - "@id": "linkedql:Difference", - "@type": "rdfs:Class", - "rdfs:comment": "Difference resolves to all the values resolved by the from step different then the values resolved by the provided steps. Caution: it might be slow to execute.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n2352625201874167266", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Select", - "@type": "rdfs:Class", - "rdfs:comment": "Select returns flat records of tags matched in the query", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n7185668025961658720", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Is", - "@type": "rdfs:Class", - "rdfs:comment": "Is resolves to all the values resolved by the from step which are included in provided values.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n7434626777184219064", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:Filter", - "@type": "rdfs:Class", - "rdfs:comment": "Apply constraints to a set of nodes. Can be used to filter values by range or match strings.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n308561566335026255", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n7752481218121017300", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:filter" - } - } - ] - }, - { - "@id": "linkedql:Follow", - "@type": "rdfs:Class", - "rdfs:comment": "The way to use a path prepared with Morphism. Applies the path chain on the morphism object to the current path. Starts as if at the g.M() and follows through the morphism path.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n5924982697949066515", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - }, - { - "@id": "_:n3698252949431811663", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:followed" - } - } - ] - }, - { - "@id": "linkedql:PropertyNames", - "@type": "rdfs:Class", - "rdfs:comment": "Get the list of predicates that are pointing out from a node.", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n2100531796371300813", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:ReverseProperties", - "@type": "rdfs:Class", - "rdfs:comment": "Gets all the properties the current entity / value is referenced at", - "rdfs:subClassOf": [ - { - "@id": "linkedql:PathStep" - }, - { - "@id": "_:n4543797063415686792", - "@type": "owl:Restriction", - "owl:cardinality": 1, - "owl:onProperty": { - "@id": "linkedql:from" - } - } - ] - }, - { - "@id": "linkedql:names", - "@type": "owl:ObjectProperty", - "rdfs:domain": { - "@id": "_:n2009243660815281193", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:Properties" - }, - { - "@id": "linkedql:ReverseProperties" - } - ] - } - }, - "rdfs:range": { - "@id": "xsd:string" - } - }, - { - "@id": "linkedql:from", - "@type": "owl:ObjectProperty", - "rdfs:domain": { - "@id": "_:n1898025205901327062", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:HasReverse" - }, - { - "@id": "linkedql:Labels" - }, - { - "@id": "linkedql:Order" - }, - { - "@id": "linkedql:Skip" - }, - { - "@id": "linkedql:ViewBoth" - }, - { - "@id": "linkedql:Count" - }, - { - "@id": "linkedql:Properties" - }, - { - "@id": "linkedql:PropertyNamesAs" - }, - { - "@id": "linkedql:As" - }, - { - "@id": "linkedql:Union" - }, - { - "@id": "linkedql:Is" - }, - { - "@id": "linkedql:ReverseProperties" - }, - { - "@id": "linkedql:Out" - }, - { - "@id": "linkedql:ReversePropertyNamesAs" - }, - { - "@id": "linkedql:View" - }, - { - "@id": "linkedql:Limit" - }, - { - "@id": "linkedql:SelectFirst" - }, - { - "@id": "linkedql:Unique" - }, - { - "@id": "linkedql:Value" - }, - { - "@id": "linkedql:Back" - }, - { - "@id": "linkedql:Select" - }, - { - "@id": "linkedql:Follow" - }, - { - "@id": "linkedql:ReversePropertyNames" - }, - { - "@id": "linkedql:FollowReverse" - }, - { - "@id": "linkedql:Difference" - }, - { - "@id": "linkedql:Intersect" - }, - { - "@id": "linkedql:ViewReverse" - }, - { - "@id": "linkedql:Filter" - }, - { - "@id": "linkedql:PropertyNames" - }, - { - "@id": "linkedql:In" - }, - { - "@id": "linkedql:Has" - } - ] - } - }, - "rdfs:range": { - "@id": "linkedql:PathStep" - } - }, - { - "@id": "linkedql:tags", - "@type": "owl:ObjectProperty", - "rdfs:domain": { - "@id": "_:n5703457665831349039", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:SelectFirst" - }, - { - "@id": "linkedql:Select" - } - ] - } - }, - "rdfs:range": { - "@id": "xsd:string" - } - }, - { - "@id": "linkedql:offset", - "@type": "owl:DatatypeProperty", - "rdfs:domain": "linkedql:Skip", - "rdfs:range": { - "@id": "xsd:int" - } - }, - { - "@id": "linkedql:name", - "@type": "owl:DatatypeProperty", - "rdfs:domain": { - "@id": "_:n441910633043105813", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:As" - }, - { - "@id": "linkedql:Back" - } - ] - } - }, - "rdfs:range": { - "@id": "xsd:string" - } - }, - { - "@id": "linkedql:followed", - "@type": "owl:ObjectProperty", - "rdfs:domain": { - "@id": "_:n5918147121052823382", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:Follow" - }, - { - "@id": "linkedql:FollowReverse" - } - ] - } - }, - "rdfs:range": { - "@id": "linkedql:PathStep" - } - }, - { - "@id": "linkedql:tag", - "@type": "owl:DatatypeProperty", - "rdfs:domain": { - "@id": "_:n2861998284995186465", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:PropertyNamesAs" - }, - { - "@id": "linkedql:ReversePropertyNamesAs" - } - ] - } - }, - "rdfs:range": { - "@id": "xsd:string" - } - }, - { - "@id": "linkedql:filter", - "@type": "owl:ObjectProperty", - "rdfs:domain": "linkedql:Filter", - "rdfs:range": { - "@id": "linkedql:Operator" - } - }, - { - "@id": "linkedql:limit", - "@type": "owl:DatatypeProperty", - "rdfs:domain": "linkedql:Limit", - "rdfs:range": { - "@id": "xsd:int" - } - }, - { - "@id": "linkedql:steps", - "@type": "owl:ObjectProperty", - "rdfs:domain": { - "@id": "_:n1702138994867097388", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:Intersect" - }, - { - "@id": "linkedql:Union" - }, - { - "@id": "linkedql:Difference" - } - ] - } - }, - "rdfs:range": { - "@id": "linkedql:PathStep" - } - }, - { - "@id": "linkedql:properties", - "@type": "owl:ObjectProperty", - "rdfs:domain": { - "@id": "_:n716290370629566278", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:Out" - }, - { - "@id": "linkedql:In" - }, - { - "@id": "linkedql:ViewBoth" - }, - { - "@id": "linkedql:ViewReverse" - }, - { - "@id": "linkedql:View" - } - ] - } - }, - "rdfs:range": { - "@id": "linkedql:PathStep" - } - }, - { - "@id": "linkedql:property", - "@type": "owl:ObjectProperty", - "rdfs:domain": { - "@id": "_:n2774302972298001908", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:Has" - }, - { - "@id": "linkedql:HasReverse" - } - ] - } - }, - "rdfs:range": { - "@id": "linkedql:PathStep" - } - }, - { - "@id": "linkedql:values", - "@type": "owl:ObjectProperty", - "rdfs:domain": { - "@id": "_:n993961146967673695", - "@type": "owl:Class", - "owl:unionOf": { - "@list": [ - { - "@id": "linkedql:Has" - }, - { - "@id": "linkedql:Vertex" - }, - { - "@id": "linkedql:HasReverse" - }, - { - "@id": "linkedql:Is" - } - ] - } - }, - "rdfs:range": { - "@id": "rdfs:Resource" - } - } - ] + "@context": { + "linkedql": { + "@id": "http://cayley.io/linkedql#" + }, + "owl": { + "@id": "http://www.w3.org/2002/07/owl#" + }, + "rdf": { + "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#" + }, + "rdfs": { + "@id": "http://www.w3.org/2000/01/rdf-schema#" + }, + "xsd": { + "@id": "http://www.w3.org/2001/XMLSchema#" + } + }, + "@graph": [ + { + "@id": "linkedql:Back", + "@type": "rdfs:Class", + "rdfs:comment": "resolves to the values of the previous the step or the values assigned to name in a former step.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n7908088290697276681", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n5997096025876839690", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:name" + } + } + ] + }, + { + "@id": "linkedql:As", + "@type": "rdfs:Class", + "rdfs:comment": "assigns the resolved values of the from step to a given name. The name can be used with the Select and Documents steps to retreive the values or to return to the values in further steps with the Back step. It resolves to the values of the from step.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n7988485489972284209", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n7567688478636418594", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:name" + } + } + ] + }, + { + "@id": "linkedql:Vertex", + "@type": "rdfs:Class", + "rdfs:comment": "resolves to all the existing objects and primitive values in the graph. If provided with values resolves to a sublist of all the existing values in the graph.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + } + ] + }, + { + "@id": "linkedql:ReversePropertyNamesAs", + "@type": "rdfs:Class", + "rdfs:comment": "tags the list of predicates that are pointing in to a node.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n8383648757660417451", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n6926458250230044772", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:tag" + } + } + ] + }, + { + "@id": "linkedql:Value", + "@type": "rdfs:Class", + "rdfs:comment": "Value returns a single value matched in the query", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n1841094452838461572", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Follow", + "@type": "rdfs:Class", + "rdfs:comment": "is the way to use a path prepared with Morphism. Applies the path chain on the morphism object to the current path. Starts as if at the g.M() and follows through the morphism path.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n2005093628341939828", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n5104241301475361160", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:followed" + } + } + ] + }, + { + "@id": "linkedql:FollowReverse", + "@type": "rdfs:Class", + "rdfs:comment": "is the same as follow but follows the chain in the reverse direction. Flips View and ViewReverse where appropriate, the net result being a virtual predicate followed in the reverse direction. Starts at the end of the morphism and follows it backwards (with appropriate flipped directions) to the g.M() location.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n4584588397207050072", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n4166975175965651772", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:followed" + } + } + ] + }, + { + "@id": "linkedql:In", + "@type": "rdfs:Class", + "rdfs:comment": "aliases for ViewReverse", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n1870897588368680998", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n3607726901418144227", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:properties" + } + } + ] + }, + { + "@id": "linkedql:ReversePropertyNames", + "@type": "rdfs:Class", + "rdfs:comment": "gets the list of predicates that are pointing in to a node.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n3903726778461453772", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Labels", + "@type": "rdfs:Class", + "rdfs:comment": "gets the list of inbound and outbound quad labels", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n2891927322902708841", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Properties", + "@type": "rdfs:Class", + "rdfs:comment": "adds tags for all properties of the current entity", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n6424233792414955944", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:PropertyNamesAs", + "@type": "rdfs:Class", + "rdfs:comment": "tags the list of predicates that are pointing out from a node.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n4418208634829485365", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n201410601521517206", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:tag" + } + } + ] + }, + { + "@id": "linkedql:Difference", + "@type": "rdfs:Class", + "rdfs:comment": "resolves to all the values resolved by the from step different then the values resolved by the provided steps. Caution: it might be slow to execute.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n3223642664820787682", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Has", + "@type": "rdfs:Class", + "rdfs:comment": "filters all paths which are, at this point, on the subject for the given predicate and object, but do not follow the path, merely filter the possible paths. Usually useful for starting with all nodes, or limiting to a subset depending on some predicate/value pair.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n2349392202041882821", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n13257026593940279", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:property" + } + } + ] + }, + { + "@id": "linkedql:HasReverse", + "@type": "rdfs:Class", + "rdfs:comment": "is the same as Has, but sets constraint in reverse direction.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n9128900241535060479", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n2741547127402511673", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:property" + } + } + ] + }, + { + "@id": "linkedql:ViewBoth", + "@type": "rdfs:Class", + "rdfs:comment": "is like View but resolves to both the object values and references to the values of the given properties in via. It is the equivalent for the Union of View and ViewReverse of the same property.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n8502434772150270123", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n5585646283882161042", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:properties" + } + } + ] + }, + { + "@id": "linkedql:Is", + "@type": "rdfs:Class", + "rdfs:comment": "resolves to all the values resolved by the from step which are included in provided values.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n3090803183809953074", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Limit", + "@type": "rdfs:Class", + "rdfs:comment": "limits a number of nodes for current path.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n853618359657221356", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n3741714749040882736", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:limit" + } + } + ] + }, + { + "@id": "linkedql:ReverseProperties", + "@type": "rdfs:Class", + "rdfs:comment": "gets all the properties the current entity / value is referenced at", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n4533390537095304805", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Select", + "@type": "rdfs:Class", + "rdfs:comment": "Select returns flat records of tags matched in the query", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n9181657233381629788", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:View", + "@type": "rdfs:Class", + "rdfs:comment": "resolves to the values of the given property or properties in via of the current objects. If via is a path it's resolved values will be used as properties.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n5824746053480877069", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n6461519520038761833", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:properties" + } + } + ] + }, + { + "@id": "linkedql:Out", + "@type": "rdfs:Class", + "rdfs:comment": "aliases for View", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n8047248095020601737", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n5222948747445626408", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:properties" + } + } + ] + }, + { + "@id": "linkedql:Placeholder", + "@type": "rdfs:Class", + "rdfs:comment": "is like Vertex but resolves to the values in the context it is placed in. It should only be used where a PathStep is expected and can't be resolved on its own.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + } + ] + }, + { + "@id": "linkedql:Count", + "@type": "rdfs:Class", + "rdfs:comment": "resolves to the number of the resolved values of the from step", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n8390472748902891963", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Filter", + "@type": "rdfs:Class", + "rdfs:comment": "applies constraints to a set of nodes. Can be used to filter values by range or match strings.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n1646447114406524394", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n8967834957155453826", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:filter" + } + } + ] + }, + { + "@id": "linkedql:Skip", + "@type": "rdfs:Class", + "rdfs:comment": "skips a number of nodes for current path.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n4098750636493779506", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n1621454338437066833", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:offset" + } + } + ] + }, + { + "@id": "linkedql:Union", + "@type": "rdfs:Class", + "rdfs:comment": "returns the combined paths of the two queries. Notice that it's per-path, not per-node. Once again, if multiple paths reach the same destination, they might have had different ways of getting there (and different tags).", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n1227112490286966331", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Unique", + "@type": "rdfs:Class", + "rdfs:comment": "removes duplicate values from the path.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n6547757674992010008", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Order", + "@type": "rdfs:Class", + "rdfs:comment": "sorts the results in ascending order according to the current entity / value", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n4036254078241711198", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:SelectFirst", + "@type": "rdfs:Class", + "rdfs:comment": "Like Select but only returns the first result", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n1197969629924875303", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:ViewReverse", + "@type": "rdfs:Class", + "rdfs:comment": "is the inverse of View. Starting with the nodes in `path` on the object, follow the quads with predicates defined by `predicatePath` to their subjects.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n6251537544036519808", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + }, + { + "@id": "_:n1051213466635448344", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:properties" + } + } + ] + }, + { + "@id": "linkedql:PropertyNames", + "@type": "rdfs:Class", + "rdfs:comment": "gets the list of predicates that are pointing out from a node.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n3269172395352052471", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:Intersect", + "@type": "rdfs:Class", + "rdfs:comment": "resolves to all the same values resolved by the from step and the provided steps.", + "rdfs:subClassOf": [ + { + "@id": "linkedql:PathStep" + }, + { + "@id": "_:n2823818453963121638", + "@type": "owl:Restriction", + "owl:cardinality": 1, + "owl:onProperty": { + "@id": "linkedql:from" + } + } + ] + }, + { + "@id": "linkedql:values", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "_:n161473765488462789", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:HasReverse" + }, + { + "@id": "linkedql:Is" + }, + { + "@id": "linkedql:Vertex" + }, + { + "@id": "linkedql:Has" + } + ] + } + }, + "rdfs:range": { + "@id": "rdfs:Resource" + } + }, + { + "@id": "linkedql:tag", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "_:n8920519548104281153", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:ReversePropertyNamesAs" + }, + { + "@id": "linkedql:PropertyNamesAs" + } + ] + } + }, + "rdfs:range": { + "@id": "xsd:string" + } + }, + { + "@id": "linkedql:properties", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "_:n3206185309683448698", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:ViewReverse" + }, + { + "@id": "linkedql:In" + }, + { + "@id": "linkedql:ViewBoth" + }, + { + "@id": "linkedql:View" + }, + { + "@id": "linkedql:Out" + } + ] + } + }, + "rdfs:range": { + "@id": "linkedql:PathStep" + } + }, + { + "@id": "linkedql:names", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "_:n8548896802306168646", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:Properties" + }, + { + "@id": "linkedql:ReverseProperties" + } + ] + } + }, + "rdfs:range": { + "@id": "xsd:string" + } + }, + { + "@id": "linkedql:property", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "_:n551031445573634888", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:Has" + }, + { + "@id": "linkedql:HasReverse" + } + ] + } + }, + "rdfs:range": { + "@id": "linkedql:PathStep" + } + }, + { + "@id": "linkedql:tags", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "_:n4101380889439320733", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:SelectFirst" + }, + { + "@id": "linkedql:Select" + } + ] + } + }, + "rdfs:range": { + "@id": "xsd:string" + } + }, + { + "@id": "linkedql:filter", + "@type": "owl:ObjectProperty", + "rdfs:domain": "linkedql:Filter", + "rdfs:range": { + "@id": "linkedql:Operator" + } + }, + { + "@id": "linkedql:name", + "@type": "owl:DatatypeProperty", + "rdfs:domain": { + "@id": "_:n4255376591434887535", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:Back" + }, + { + "@id": "linkedql:As" + } + ] + } + }, + "rdfs:range": { + "@id": "xsd:string" + } + }, + { + "@id": "linkedql:followed", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "_:n5693611581576660543", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:Follow" + }, + { + "@id": "linkedql:FollowReverse" + } + ] + } + }, + "rdfs:range": { + "@id": "linkedql:PathStep" + } + }, + { + "@id": "linkedql:steps", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "_:n4411805662897003741", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:Difference" + }, + { + "@id": "linkedql:Union" + }, + { + "@id": "linkedql:Intersect" + } + ] + } + }, + "rdfs:range": { + "@id": "linkedql:PathStep" + } + }, + { + "@id": "linkedql:limit", + "@type": "owl:DatatypeProperty", + "rdfs:domain": "linkedql:Limit", + "rdfs:range": { + "@id": "xsd:int" + } + }, + { + "@id": "linkedql:offset", + "@type": "owl:DatatypeProperty", + "rdfs:domain": "linkedql:Skip", + "rdfs:range": { + "@id": "xsd:int" + } + }, + { + "@id": "linkedql:from", + "@type": "owl:ObjectProperty", + "rdfs:domain": { + "@id": "_:n7112012358991747784", + "@type": "owl:Class", + "owl:unionOf": { + "@list": [ + { + "@id": "linkedql:ReversePropertyNames" + }, + { + "@id": "linkedql:Has" + }, + { + "@id": "linkedql:Count" + }, + { + "@id": "linkedql:Filter" + }, + { + "@id": "linkedql:ViewReverse" + }, + { + "@id": "linkedql:Follow" + }, + { + "@id": "linkedql:HasReverse" + }, + { + "@id": "linkedql:Is" + }, + { + "@id": "linkedql:ReverseProperties" + }, + { + "@id": "linkedql:Select" + }, + { + "@id": "linkedql:View" + }, + { + "@id": "linkedql:Unique" + }, + { + "@id": "linkedql:As" + }, + { + "@id": "linkedql:In" + }, + { + "@id": "linkedql:Limit" + }, + { + "@id": "linkedql:PropertyNames" + }, + { + "@id": "linkedql:Back" + }, + { + "@id": "linkedql:ReversePropertyNamesAs" + }, + { + "@id": "linkedql:Order" + }, + { + "@id": "linkedql:Value" + }, + { + "@id": "linkedql:PropertyNamesAs" + }, + { + "@id": "linkedql:Difference" + }, + { + "@id": "linkedql:ViewBoth" + }, + { + "@id": "linkedql:Skip" + }, + { + "@id": "linkedql:SelectFirst" + }, + { + "@id": "linkedql:Union" + }, + { + "@id": "linkedql:Intersect" + }, + { + "@id": "linkedql:Labels" + }, + { + "@id": "linkedql:FollowReverse" + }, + { + "@id": "linkedql:Properties" + }, + { + "@id": "linkedql:Out" + } + ] + } + }, + "rdfs:range": { + "@id": "linkedql:PathStep" + } + } + ] } diff --git a/query/linkedql/client/client.go b/query/linkedql/client/client.go index 4bcdba0cd..70a68244b 100644 --- a/query/linkedql/client/client.go +++ b/query/linkedql/client/client.go @@ -6,117 +6,117 @@ import ( type Path map[string]interface{} -// As As assigns the resolved values of the from step to a given name. The name can be used with the Select and Documents steps to retreive the values or to return to the values in further steps with the Back step. It resolves to the values of the from step. +// As assigns the resolved values of the from step to a given name. The name can be used with the Select and Documents steps to retreive the values or to return to the values in further steps with the Back step. It resolves to the values of the from step. func (p Path) As(name string) Path { return Path{"@type": "http://cayley.io/linkedql#As", "from": p, "http://cayley.io/linkedql#name": name} } -// Back Back resolves to the values of the previous the step or the values assigned to name in a former step. +// Back resolves to the values of the previous the step or the values assigned to name in a former step. func (p Path) Back(name string) Path { return Path{"@type": "http://cayley.io/linkedql#Back", "from": p, "http://cayley.io/linkedql#name": name} } -// Count Count resolves to the number of the resolved values of the from step +// Count resolves to the number of the resolved values of the from step func (p Path) Count() Path { return Path{"@type": "http://cayley.io/linkedql#Count", "from": p} } -// Difference Difference resolves to all the values resolved by the from step different then the values resolved by the provided steps. Caution: it might be slow to execute. +// Difference resolves to all the values resolved by the from step different then the values resolved by the provided steps. Caution: it might be slow to execute. func (p Path) Difference(steps []Path) Path { return Path{"@type": "http://cayley.io/linkedql#Difference", "from": p, "http://cayley.io/linkedql#steps": steps} } -// Filter Apply constraints to a set of nodes. Can be used to filter values by range or match strings. +// Filter applies constraints to a set of nodes. Can be used to filter values by range or match strings. func (p Path) Filter() Path { return Path{"@type": "http://cayley.io/linkedql#Filter", "from": p} } -// Follow The way to use a path prepared with Morphism. Applies the path chain on the morphism object to the current path. Starts as if at the g.M() and follows through the morphism path. +// Follow is the way to use a path prepared with Morphism. Applies the path chain on the morphism object to the current path. Starts as if at the g.M() and follows through the morphism path. func (p Path) Follow(followed Path) Path { return Path{"@type": "http://cayley.io/linkedql#Follow", "from": p, "http://cayley.io/linkedql#followed": followed} } -// FollowReverse The same as follow but follows the chain in the reverse direction. Flips View and ViewReverse where appropriate, the net result being a virtual predicate followed in the reverse direction. Starts at the end of the morphism and follows it backwards (with appropriate flipped directions) to the g.M() location. +// FollowReverse is the same as follow but follows the chain in the reverse direction. Flips View and ViewReverse where appropriate, the net result being a virtual predicate followed in the reverse direction. Starts at the end of the morphism and follows it backwards (with appropriate flipped directions) to the g.M() location. func (p Path) FollowReverse(followed Path) Path { return Path{"@type": "http://cayley.io/linkedql#FollowReverse", "from": p, "http://cayley.io/linkedql#followed": followed} } -// Has Filter all paths which are, at this point, on the subject for the given predicate and object, but do not follow the path, merely filter the possible paths. Usually useful for starting with all nodes, or limiting to a subset depending on some predicate/value pair. +// Has filters all paths which are, at this point, on the subject for the given predicate and object, but do not follow the path, merely filter the possible paths. Usually useful for starting with all nodes, or limiting to a subset depending on some predicate/value pair. func (p Path) Has(property Path, values []quad.Value) Path { return Path{"@type": "http://cayley.io/linkedql#Has", "from": p, "http://cayley.io/linkedql#property": property, "http://cayley.io/linkedql#values": values} } -// HasReverse The same as Has, but sets constraint in reverse direction. +// HasReverse is the same as Has, but sets constraint in reverse direction. func (p Path) HasReverse(property Path, values []quad.Value) Path { return Path{"@type": "http://cayley.io/linkedql#HasReverse", "from": p, "http://cayley.io/linkedql#property": property, "http://cayley.io/linkedql#values": values} } -// In Alias for ViewReverse +// In aliases for ViewReverse func (p Path) In(properties Path) Path { return Path{"@type": "http://cayley.io/linkedql#In", "from": p, "http://cayley.io/linkedql#properties": properties} } -// Intersect Intersect resolves to all the same values resolved by the from step and the provided steps. +// Intersect resolves to all the same values resolved by the from step and the provided steps. func (p Path) Intersect(steps []Path) Path { return Path{"@type": "http://cayley.io/linkedql#Intersect", "from": p, "http://cayley.io/linkedql#steps": steps} } -// Is Is resolves to all the values resolved by the from step which are included in provided values. +// Is resolves to all the values resolved by the from step which are included in provided values. func (p Path) Is(values []quad.Value) Path { return Path{"@type": "http://cayley.io/linkedql#Is", "from": p, "http://cayley.io/linkedql#values": values} } -// Labels Get the list of inbound and outbound quad labels +// Labels gets the list of inbound and outbound quad labels func (p Path) Labels() Path { return Path{"@type": "http://cayley.io/linkedql#Labels", "from": p} } -// Limit Limit a number of nodes for current path. +// Limit limits a number of nodes for current path. func (p Path) Limit() Path { return Path{"@type": "http://cayley.io/linkedql#Limit", "from": p} } -// Order Order sorts the results in ascending order according to the current entity / value +// Order sorts the results in ascending order according to the current entity / value func (p Path) Order() Path { return Path{"@type": "http://cayley.io/linkedql#Order", "from": p} } -// Out Alias for View +// Out aliases for View func (p Path) Out(properties Path) Path { return Path{"@type": "http://cayley.io/linkedql#Out", "from": p, "http://cayley.io/linkedql#properties": properties} } -// Placeholder Placeholder is like Vertex but resolves to the values in the context it is placed in. It should only be used where a PathStep is expected and can't be resolved on its own. +// Placeholder is like Vertex but resolves to the values in the context it is placed in. It should only be used where a PathStep is expected and can't be resolved on its own. func Placeholder() Path { return Path{"@type": "http://cayley.io/linkedql#Placeholder"} } -// Properties Adds tags for all properties of the current entity +// Properties adds tags for all properties of the current entity func (p Path) Properties(names []string) Path { return Path{"@type": "http://cayley.io/linkedql#Properties", "from": p, "http://cayley.io/linkedql#names": names} } -// PropertyNames Get the list of predicates that are pointing out from a node. +// PropertyNames gets the list of predicates that are pointing out from a node. func (p Path) PropertyNames() Path { return Path{"@type": "http://cayley.io/linkedql#PropertyNames", "from": p} } -// PropertyNamesAs Tag the list of predicates that are pointing out from a node. +// PropertyNamesAs tags the list of predicates that are pointing out from a node. func (p Path) PropertyNamesAs(tag string) Path { return Path{"@type": "http://cayley.io/linkedql#PropertyNamesAs", "from": p, "http://cayley.io/linkedql#tag": tag} } -// ReverseProperties Gets all the properties the current entity / value is referenced at +// ReverseProperties gets all the properties the current entity / value is referenced at func (p Path) ReverseProperties(names []string) Path { return Path{"@type": "http://cayley.io/linkedql#ReverseProperties", "from": p, "http://cayley.io/linkedql#names": names} } -// ReversePropertyNames Get the list of predicates that are pointing in to a node. +// ReversePropertyNames gets the list of predicates that are pointing in to a node. func (p Path) ReversePropertyNames() Path { return Path{"@type": "http://cayley.io/linkedql#ReversePropertyNames", "from": p} } -// ReversePropertyNamesAs Tag the list of predicates that are pointing in to a node. +// ReversePropertyNamesAs tags the list of predicates that are pointing in to a node. func (p Path) ReversePropertyNamesAs(tag string) Path { return Path{"@type": "http://cayley.io/linkedql#ReversePropertyNamesAs", "from": p, "http://cayley.io/linkedql#tag": tag} } @@ -131,17 +131,17 @@ func (p Path) SelectFirst(tags []string) Path { return Path{"@type": "http://cayley.io/linkedql#SelectFirst", "from": p, "http://cayley.io/linkedql#tags": tags} } -// Skip Skip a number of nodes for current path. +// Skip skips a number of nodes for current path. func (p Path) Skip() Path { return Path{"@type": "http://cayley.io/linkedql#Skip", "from": p} } -// Union Return the combined paths of the two queries. Notice that it's per-path, not per-node. Once again, if multiple paths reach the same destination, they might have had different ways of getting there (and different tags). +// Union returns the combined paths of the two queries. Notice that it's per-path, not per-node. Once again, if multiple paths reach the same destination, they might have had different ways of getting there (and different tags). func (p Path) Union(steps []Path) Path { return Path{"@type": "http://cayley.io/linkedql#Union", "from": p, "http://cayley.io/linkedql#steps": steps} } -// Unique Remove duplicate values from the path. +// Unique removes duplicate values from the path. func (p Path) Unique() Path { return Path{"@type": "http://cayley.io/linkedql#Unique", "from": p} } @@ -151,22 +151,22 @@ func (p Path) Value() Path { return Path{"@type": "http://cayley.io/linkedql#Value", "from": p} } -// Vertex Vertex resolves to all the existing objects and primitive values in the graph. If provided with values resolves to a sublist of all the existing values in the graph. +// Vertex resolves to all the existing objects and primitive values in the graph. If provided with values resolves to a sublist of all the existing values in the graph. func Vertex(values []quad.Value) Path { return Path{"@type": "http://cayley.io/linkedql#Vertex", "http://cayley.io/linkedql#values": values} } -// View View resolves to the values of the given property or properties in via of the current objects. If via is a path it's resolved values will be used as properties. +// View resolves to the values of the given property or properties in via of the current objects. If via is a path it's resolved values will be used as properties. func (p Path) View(properties Path) Path { return Path{"@type": "http://cayley.io/linkedql#View", "from": p, "http://cayley.io/linkedql#properties": properties} } -// ViewBoth ViewBoth is like View but resolves to both the object values and references to the values of the given properties in via. It is the equivalent for the Union of View and ViewReverse of the same property. +// ViewBoth is like View but resolves to both the object values and references to the values of the given properties in via. It is the equivalent for the Union of View and ViewReverse of the same property. func (p Path) ViewBoth(properties Path) Path { return Path{"@type": "http://cayley.io/linkedql#ViewBoth", "from": p, "http://cayley.io/linkedql#properties": properties} } -// ViewReverse The inverse of View. Starting with the nodes in `path` on the object, follow the quads with predicates defined by `predicatePath` to their subjects. +// ViewReverse is the inverse of View. Starting with the nodes in `path` on the object, follow the quads with predicates defined by `predicatePath` to their subjects. func (p Path) ViewReverse(properties Path) Path { return Path{"@type": "http://cayley.io/linkedql#ViewReverse", "from": p, "http://cayley.io/linkedql#properties": properties} }