You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rya.apache.org by ca...@apache.org on 2018/01/11 14:52:03 UTC
[4/6] incubator-rya git commit: RYA-417 Batch forward-chaining rules
engine. Closes #255.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9f611019/extras/rya.forwardchain/src/test/resources/owlrl.ttl
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/test/resources/owlrl.ttl b/extras/rya.forwardchain/src/test/resources/owlrl.ttl
new file mode 100644
index 0000000..b9e67eb
--- /dev/null
+++ b/extras/rya.forwardchain/src/test/resources/owlrl.ttl
@@ -0,0 +1,106 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Expresses a fragment of OWL RL in SPIN rules
+
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix lubm: <http://swat.cse.lehigh.edu/onto/univ-bench.owl#> .
+@prefix spin: <http://spinrdf.org/spin#> .
+@prefix sp: <http://spinrdf.org/sp#> .
+@prefix rl: <http://example.org/OWL/RL/> .
+
+owl:Thing spin:rule rl:cls-svf1 ,
+ rl:cax-sco ,
+ rl:prp-spo1 ,
+ rl:prp-dom ,
+ rl:prp-rng .
+
+owl:Class spin:rule rl:scm-cls .
+
+rl:cls-svf1 a sp:Construct;
+ spin:thisUnbound "true"^^xsd:boolean ;
+ sp:text """
+ CONSTRUCT {
+ ?u a ?x .
+ }
+ WHERE {
+ ?x owl:someValuesFrom ?y .
+ ?x owl:onProperty ?p .
+ ?u ?p ?v .
+ ?v a ?y .
+ } """ .
+
+rl:cax-sco a sp:Construct;
+ spin:thisUnbound "true"^^xsd:boolean ;
+ sp:text """
+ CONSTRUCT {
+ ?this a ?super .
+ }
+ WHERE {
+ ?this a ?sub .
+ ?sub rdfs:subClassOf ?super .
+ } """ .
+
+rl:prp-spo1 a sp:Construct;
+ spin:thisUnbound "true"^^xsd:boolean ;
+ sp:text """
+ CONSTRUCT {
+ ?x ?super ?y .
+ }
+ WHERE {
+ ?sub rdfs:subPropertyOf ?super .
+ ?x ?sub ?y .
+ } """ .
+
+rl:prp-dom a sp:Construct;
+ spin:thisUnbound "true"^^xsd:boolean ;
+ sp:text """
+ CONSTRUCT {
+ ?s a ?c .
+ }
+ WHERE {
+ ?p rdfs:domain ?c .
+ ?s ?p ?o .
+ } """ .
+
+rl:prp-rng a rl:prp-rng-template .
+rl:prp-rng-template a sp:Template;
+ spin:body [
+ a sp:Construct ;
+ sp:text """
+ CONSTRUCT {
+ ?o a ?c .
+ }
+ WHERE {
+ ?p rdfs:range ?c .
+ ?s ?p ?o .
+ } """ ] .
+
+rl:scm-cls a sp:Construct;
+ sp:text """
+ CONSTRUCT {
+ ?this rdfs:subClassOf ?this .
+ ?this owl:equivalentClass ?this .
+ ?this rdfs:subClassOf owl:Thing .
+ owl:Nothing rdfs:subClassOf ?this .
+ }
+ WHERE { } """ .
+rdfs:subClassOf rdfs:domain owl:Class .
+rdfs:subClassOf rdfs:range owl:Class .
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9f611019/extras/rya.forwardchain/src/test/resources/query.sparql
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/test/resources/query.sparql b/extras/rya.forwardchain/src/test/resources/query.sparql
new file mode 100644
index 0000000..3b93cc8
--- /dev/null
+++ b/extras/rya.forwardchain/src/test/resources/query.sparql
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# LUBM query #12
+
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX owl: <http://www.w3.org/2002/07/owl#>
+PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
+PREFIX lubm: <http://swat.cse.lehigh.edu/onto/univ-bench.owl#>
+PREFIX ex: <http://example.org/>
+
+SELECT ?X ?Y WHERE {
+ ?X a lubm:Chair .
+ ?Y a lubm:Department .
+ ?X lubm:worksFor ?Y .
+ ?Y lubm:subOrganizationOf ex:University0 .
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9f611019/extras/rya.forwardchain/src/test/resources/university.ttl
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/test/resources/university.ttl b/extras/rya.forwardchain/src/test/resources/university.ttl
new file mode 100644
index 0000000..e195606
--- /dev/null
+++ b/extras/rya.forwardchain/src/test/resources/university.ttl
@@ -0,0 +1,58 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Expresses a fragment of the LUBM ontology in a mixture of OWL and SPIN
+
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix lubm: <http://swat.cse.lehigh.edu/onto/univ-bench.owl#> .
+@prefix spin: <http://spinrdf.org/spin#> .
+@prefix sp: <http://spinrdf.org/sp#> .
+@prefix lr: <http://example.org/LUBM/> .
+
+lubm:Person spin:rule lr:department-head-is-chair .
+lr:department-head-is-chair a sp:Construct ;
+ sp:text """
+ PREFIX lubm: <http://swat.cse.lehigh.edu/onto/univ-bench.owl#>
+ CONSTRUCT {
+ ?this a lubm:Chair .
+ }
+ WHERE {
+ ?this lubm:headOf [ a lubm:Department ] .
+ }
+ """ .
+
+lubm:Organization spin:rule lr:suborganization-transitivity .
+lr:suborganization-transitivity a sp:Construct ;
+ sp:text """
+ PREFIX lubm: <http://swat.cse.lehigh.edu/onto/univ-bench.owl#>
+ CONSTRUCT {
+ ?this lubm:subOrganizationOf ?parent .
+ }
+ WHERE {
+ ?this lubm:subOrganizationOf ?child .
+ ?child lubm:subOrganizationOf ?parent .
+ }
+ """ .
+
+lubm:Professor rdfs:subClassOf lubm:Faculty .
+lubm:Faculty rdfs:subClassOf lubm:Person .
+
+lubm:worksFor rdfs:range lubm:Organization .
+lubm:headOf rdfs:subPropertyOf lubm:worksFor .
\ No newline at end of file