Permalink
Browse files

initial code for sparql2xquery translation

  • Loading branch information...
0 parents commit ebe9775ae38f43e2da57de616f1bec5435416d06 @lidingpku lidingpku committed Apr 4, 2011
Showing with 3,471 additions and 0 deletions.
  1. +41 −0 .classpath
  2. +17 −0 .project
  3. +34 −0 data/bakesale/bs-event.ttl
  4. +39 −0 data/bakesale/bs-location.ttl
  5. +88 −0 data/bakesale/bs-ontology.ttl
  6. +18 −0 data/bakesale/bs-student.ttl
  7. +29 −0 data/bakesale/bs-work.ttl
  8. +6 −0 data/bakesale/sparql/bakesale-query-31.sparql
  9. +10 −0 data/bakesale/sparql/bakesale-query-32.sparql
  10. +32 −0 data/bakesale/sparql/bakesale-query-33.sparql
  11. +17 −0 data/bakesale/sparql/bakesale-query-34.sparql
  12. +18 −0 data/bakesale/sparql/bakesale-query-36.sparql
  13. +26 −0 lib/pellet2.2.2/antlr/LICENSE.txt
  14. BIN lib/pellet2.2.2/antlr/antlr-runtime-3.2.jar
  15. BIN lib/pellet2.2.2/aterm-java-1.6.jar
  16. BIN lib/pellet2.2.2/jaxb/jaxb-api.jar
  17. +774 −0 lib/pellet2.2.2/jaxb/license.txt
  18. +2 −0 lib/pellet2.2.2/jaxb/version.txt
  19. BIN lib/pellet2.2.2/jena/arq-2.8.4.jar
  20. +30 −0 lib/pellet2.2.2/jena/copyright.txt
  21. BIN lib/pellet2.2.2/jena/icu4j-3.4.4.jar
  22. BIN lib/pellet2.2.2/jena/iri-0.8-sources.jar
  23. BIN lib/pellet2.2.2/jena/iri-0.8.jar
  24. BIN lib/pellet2.2.2/jena/jena-2.6.3-tests.jar
  25. BIN lib/pellet2.2.2/jena/jena-2.6.3.jar
  26. BIN lib/pellet2.2.2/jena/junit-4.5.jar
  27. BIN lib/pellet2.2.2/jena/log4j-1.2.13.jar
  28. BIN lib/pellet2.2.2/jena/lucene-core-2.3.1.jar
  29. BIN lib/pellet2.2.2/jena/slf4j-api-1.5.8.jar
  30. BIN lib/pellet2.2.2/jena/slf4j-log4j12-1.5.8.jar
  31. BIN lib/pellet2.2.2/jena/stax-api-1.0.1.jar
  32. +1 −0 lib/pellet2.2.2/jena/version.txt
  33. BIN lib/pellet2.2.2/jena/wstx-asl-3.2.9.jar
  34. BIN lib/pellet2.2.2/jena/xercesImpl-2.7.1.jar
  35. BIN lib/pellet2.2.2/jetty/commons-logging-api.jar
  36. BIN lib/pellet2.2.2/jetty/jetty.jar
  37. +1 −0 lib/pellet2.2.2/jetty/version.txt
  38. BIN lib/pellet2.2.2/jgrapht/jgrapht-jdk1.5.jar
  39. +504 −0 lib/pellet2.2.2/jgrapht/license.txt
  40. +4 −0 lib/pellet2.2.2/jgrapht/version.txt
  41. BIN lib/pellet2.2.2/junit/junit.jar
  42. +4 −0 lib/pellet2.2.2/junit/version.txt
  43. +165 −0 lib/pellet2.2.2/owlapi/license.txt
  44. BIN lib/pellet2.2.2/owlapi/owlapi-bin.jar
  45. BIN lib/pellet2.2.2/owlapi/owlapi-src.jar
  46. +3 −0 lib/pellet2.2.2/owlapi/version.txt
  47. +165 −0 lib/pellet2.2.2/owlapiv3/license.txt
  48. BIN lib/pellet2.2.2/owlapiv3/owlapi-bin.jar
  49. BIN lib/pellet2.2.2/owlapiv3/owlapi-src.jar
  50. +3 −0 lib/pellet2.2.2/owlapiv3/version.txt
  51. BIN lib/pellet2.2.2/pellet-cli.jar
  52. BIN lib/pellet2.2.2/pellet-core.jar
  53. BIN lib/pellet2.2.2/pellet-datatypes.jar
  54. BIN lib/pellet2.2.2/pellet-dig.jar
  55. BIN lib/pellet2.2.2/pellet-el.jar
  56. BIN lib/pellet2.2.2/pellet-explanation.jar
  57. BIN lib/pellet2.2.2/pellet-jena.jar
  58. BIN lib/pellet2.2.2/pellet-modularity.jar
  59. BIN lib/pellet2.2.2/pellet-owlapi.jar
  60. BIN lib/pellet2.2.2/pellet-owlapiv3.jar
  61. BIN lib/pellet2.2.2/pellet-pellint.jar
  62. BIN lib/pellet2.2.2/pellet-query.jar
  63. BIN lib/pellet2.2.2/pellet-rules.jar
  64. BIN lib/pellet2.2.2/pellet-test.jar
  65. BIN lib/pellet2.2.2/servlet.jar
  66. BIN lib/pellet2.2.2/xsdlib/relaxngDatatype.jar
  67. +7 −0 lib/pellet2.2.2/xsdlib/version.txt
  68. BIN lib/pellet2.2.2/xsdlib/xsdlib.jar
  69. BIN lib/sw4j-0.6.jar
  70. BIN lib/tdb-0.8.8/arq-2.8.7-tests.jar
  71. BIN lib/tdb-0.8.8/arq-2.8.7.jar
  72. BIN lib/tdb-0.8.8/icu4j-3.4.4.jar
  73. BIN lib/tdb-0.8.8/iri-0.8.jar
  74. BIN lib/tdb-0.8.8/jena-2.6.4-tests.jar
  75. BIN lib/tdb-0.8.8/jena-2.6.4.jar
  76. BIN lib/tdb-0.8.8/junit-4.5.jar
  77. BIN lib/tdb-0.8.8/log4j-1.2.14.jar
  78. BIN lib/tdb-0.8.8/lucene-core-2.3.1.jar
  79. BIN lib/tdb-0.8.8/slf4j-api-1.5.8.jar
  80. BIN lib/tdb-0.8.8/slf4j-log4j12-1.5.8.jar
  81. BIN lib/tdb-0.8.8/stax-api-1.0.1.jar
  82. BIN lib/tdb-0.8.8/tdb-0.8.8-tests.jar
  83. BIN lib/tdb-0.8.8/tdb-0.8.8.jar
  84. BIN lib/tdb-0.8.8/wstx-asl-3.2.9.jar
  85. BIN lib/tdb-0.8.8/xercesImpl-2.7.1.jar
  86. +263 −0 src/com/marklogic/sparql2xquery/example/ExampleBakesale.java
  87. +24 −0 src/com/marklogic/sparql2xquery/example/ToolDataLoader.java
  88. +12 −0 src/com/marklogic/sparql2xquery/translator/S2XAbstractElementVisitor.java
  89. +17 −0 src/com/marklogic/sparql2xquery/translator/S2XFilter.java
  90. +22 −0 src/com/marklogic/sparql2xquery/translator/S2XQuadBlock.java
  91. +91 −0 src/com/marklogic/sparql2xquery/translator/S2XQuadPath.java
  92. +109 −0 src/com/marklogic/sparql2xquery/translator/S2XTranslator.java
  93. +337 −0 src/com/marklogic/sparql2xquery/translator/v4/S2XElementVisitor.java
  94. +201 −0 src/com/marklogic/sparql2xquery/translator/v4/S2XExprVisitor.java
  95. +357 −0 src/com/marklogic/sparql2xquery/translator/v4/S2XQueryBuilder.java
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/aterm-java-1.6.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-cli.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-core.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-datatypes.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-dig.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-el.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-explanation.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-jena.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-modularity.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-owlapi.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-owlapiv3.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-pellint.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-query.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-rules.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/pellet-test.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/servlet.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/copyright.txt"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/icu4j-3.4.4.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/iri-0.8-sources.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/iri-0.8.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/jena-2.6.3-tests.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/jena-2.6.3.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/junit-4.5.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/log4j-1.2.13.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/lucene-core-2.3.1.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/slf4j-api-1.5.8.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/slf4j-log4j12-1.5.8.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/stax-api-1.0.1.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/version.txt"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/wstx-asl-3.2.9.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/xercesImpl-2.7.1.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/xsdlib/relaxngDatatype.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/xsdlib/xsdlib.jar"/>
+ <classpathentry kind="lib" path="lib/pellet2.2.2/jena/arq-2.8.4.jar"/>
+ <classpathentry kind="lib" path="lib/sw4j-0.6.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>github-sparql2xquery</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,34 @@
+@prefix bs-work: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-work.ttl#> .
+@prefix bs-location: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-location.ttl#> .
+@prefix bs-student: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-student.ttl#> .
+@prefix bs-event: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-event.ttl#> .
+@prefix p: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix i: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+
+bs-event:BS_1 rdf:type c:Bake_Sale_Event .
+bs-event:BS_1 p:location bs-location:Buffalo_NY .
+bs-event:BS_1 p:seller bs-student:Alice.
+bs-event:BS_1 p:product bs-event:cookie_x .
+
+bs-event:BS_2 rdf:type c:Bake_Sale_Event .
+bs-event:BS_2 p:location bs-location:Albany_NY .
+bs-event:BS_2 p:seller bs-student:Alice.
+bs-event:BS_2 p:product bs-event:cookie_y .
+
+bs-event:BS_3 rdf:type c:Bake_Sale_Event .
+bs-event:BS_3 p:location bs-location:Austin_TX .
+bs-event:BS_3 p:seller bs-student:John.
+bs-event:BS_3 p:product bs-event:cookie_z .
+
+bs-event:cookie_x rdf:type c:Chocolate_Cookie .
+
+bs-event:cookie_y rdf:type c:Sugar_Cookie .
+
+bs-event:cookie_z rdf:type c:Cookie .
+bs-event:cookie_z p:ingredient i:chocolatechip .
+
@@ -0,0 +1,39 @@
+@prefix bs-location: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-location.ttl#> .
+@prefix p: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+
+
+bs-location:Buffalo_NY rdf:type c:Location .
+bs-location:Buffalo_NY geo:lat 42.93 .
+bs-location:Buffalo_NY geo:long -78.73 .
+bs-location:Buffalo_NY p:location bs-location:New_York_State .
+bs-location:Buffalo_NY rdfs:label "Buffalo, NY" .
+
+bs-location:Albany_NY rdf:type c:Location .
+bs-location:Albany_NY geo:lat 42.75 .
+bs-location:Albany_NY geo:long -73.80 .
+bs-location:Albany_NY p:location bs-location:New_York_State .
+bs-location:Albany_NY rdfs:label "Albany, NY" .
+
+bs-location:Austin_TX rdf:type c:Location .
+bs-location:Austin_TX geo:lat 30.27 .
+bs-location:Austin_TX geo:long -97.74 .
+bs-location:Austin_TX p:location bs-location:Texas .
+bs-location:Austin_TX rdfs:label "Austin, TX" .
+
+bs-location:JFK_Airport rdf:type c:Location .
+bs-location:JFK_Airport geo:lat 40.65.
+bs-location:JFK_Airport geo:long 73.78 .
+bs-location:JFK_Airport p:location bs-location:New_York_State .
+bs-location:JFK_Airport rdfs:label "John F. Kennedy International Airport" .
+
+
+bs-location:New_York_State rdf:type c:State .
+bs-location:New_York_State rdfs:label "New York" .
+
+bs-location:Texas rdf:type c:State .
+bs-location:Texas rdfs:label "Texas" .
@@ -0,0 +1,88 @@
+@prefix p: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix i: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+c:Thing rdf:type owl:Class.
+
+c:Event rdf:type owl:Class.
+c:Event rdfs:subClassOf c:Thing.
+
+c:Person rdf:type owl:Class.
+c:Person rdfs:subClassOf c:Thing.
+
+c:Location rdf:type owl:Class.
+c:Location rdfs:subClassOf c:Thing.
+
+c:State rdf:type owl:Class.
+c:State rdfs:subClassOf c:Location.
+
+c:Bake_Sale_Event rdf:type owl:Class.
+c:Bake_Sale_Event rdfs:subClassOf c:Event.
+
+c:Manager rdf:type owl:Class.
+c:Manager rdfs:subClassOf c:Person.
+
+c:Student rdf:type owl:Class.
+c:Student rdfs:subClassOf c:Person.
+
+c:Graduate_Student rdf:type owl:Class.
+c:Graduate_Student rdfs:subClassOf c:Student.
+
+c:Undergraduate_Student rdf:type owl:Class.
+c:Undergraduate_Student rdfs:subClassOf c:Student.
+
+c:PhD_Student rdf:type owl:Class.
+c:PhD_Student rdfs:subClassOf c:Graduate_Student.
+
+
+c:Cookie rdf:type owl:Class.
+c:Cookie rdfs:subClassOf c:Thing.
+
+c:Chocolate_Cookie rdf:type owl:Class.
+c:Chocolate_Cookie rdfs:subClassOf c:Cookie.
+c:Chocolate_Cookie rdfs:subClassOf c:restriction1 .
+
+c:restriction1
+ a owl:Restriction;
+ owl:onProperty p:ingredient;
+ owl:hasValue i:chocolatechip .
+
+i:chocolatechip rdf:type c:Thing .
+
+c:Sugar_Cookie rdf:type owl:Class.
+c:Sugar_Cookie rdfs:subClassOf c:Cookie.
+
+p:social_relation rdf:type owl:ObjectProperty .
+
+p:relative rdf:type owl:SymmetricProperty .
+p:relative rdfs:subPropertyOf p:social_relation .
+
+p:employment_relation rdf:type owl:SymmetricProperty .
+p:employment_relation rdfs:subPropertyOf p:social_relation .
+
+p:parent rdf:type owl:ObjectProperty .
+p:parent rdfs:subPropertyOf p:relative .
+
+p:child rdf:type owl:ObjectProperty .
+p:child rdfs:subPropertyOf p:relative .
+p:child owl:inverseOf p:parent .
+
+p:supervisor rdf:type owl:ObjectProperty .
+p:supervisor rdfs:subPropertyOf p:colleague .
+
+p:colleague rdf:type owl:SymmetricProperty .
+p:colleague rdfs:subPropertyOf p:employment_relation .
+
+p:ingredient rdf:type owl:ObjectProperty .
+p:product rdf:type owl:ObjectProperty .
+p:seller rdf:type owl:ObjectProperty .
+
+p:home_city rdf:type owl:ObjectProperty .
+p:home_city rdfs:subPropertyOf p:location .
+
+p:location rdf:type owl:TransitiveProperty .
+
@@ -0,0 +1,18 @@
+@prefix bs-work: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-work.ttl#> .
+@prefix bs-location: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-location.ttl#> .
+@prefix bs-student: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-student.ttl#> .
+@prefix p: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+bs-student:Alice rdf:type c:Undergraduate_Student .
+bs-student:Alice p:relative bs-student:John .
+bs-student:Alice p:parent bs-work:Bob .
+
+
+bs-student:John rdf:type c:PhD_Student .
+
+bs-student:Kevin rdf:type c:Graduate_Student .
+bs-student:Kevin p:relative bs-student:John .
@@ -0,0 +1,29 @@
+@prefix bs-work: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-work.ttl#> .
+@prefix bs-location: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-location.ttl#> .
+@prefix bs-student: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-student.ttl#> .
+@prefix p: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+bs-work:Bob rdf:type c:Person .
+bs-work:Bob p:home_city bs-location:Buffalo_NY .
+bs-work:Bob p:supervisor bs-work:Cyndi .
+
+bs-work:Cyndi rdf:type c:Manager .
+
+bs-work:Frank rdf:type c:Person .
+bs-work:Frank p:supervisor bs-work:Cyndi .
+bs-work:Frank p:colleague bs-work:David.
+
+bs-work:David rdf:type c:Manager .
+bs-work:David p:supervisor bs-work:George .
+bs-work:David p:home_city bs-location:Austin_TX .
+bs-work:David p:child bs-work:John.
+
+bs-work:John owl:sameAs bs-student:John .
+
+
+bs-work:George rdf:type c:Manager .
@@ -0,0 +1,6 @@
+# bakesale-query-31: list all instance of Person (including direct instances and inferred instances).
+
+PREFIX c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+SELECT ?s ?type
+WHERE { ?s a c:Person . }
+ORDER BY ?s
@@ -0,0 +1,10 @@
+# bakesale-query-32: list all employment relations and show the actual relation
+
+PREFIX c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+PREFIX p: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+SELECT ?s ?p ?o
+WHERE {
+ ?s ?p ?o.
+ ?p rdfs:subPropertyOf p:employment_relation .
+}
@@ -0,0 +1,32 @@
+# bakesale-query-33: list student and manager pairs, each of which is connected by no more than three hops social relation
+
+PREFIX c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+SELECT distinct ?student ?manager ?o1 ?o2
+WHERE {
+ ?student a c:Student .
+ FILTER (?student != ?manager )
+ {
+ {
+ ?student c:social_relation ?manager .
+ }
+ UNION
+ {
+ ?student c:social_relation ?o1.
+ ?o1 c:social_relation ?manager .
+ FILTER (?student != ?o1 && ?manager != ?o1 )
+ }
+ UNION
+ {
+ ?student c:social_relation ?o1.
+ ?o1 c:social_relation ?o2.
+ ?o2 c:social_relation ?manager .
+ FILTER (
+ ?student != ?o1 && ?manager != ?o1
+ && ?student != ?o2 && ?manager != ?o2
+ && ?o1 != ?o2 )
+ }
+ }
+ ?manager a c:Manager.
+}
+ORDER BY ?o2 ?o1
@@ -0,0 +1,17 @@
+# bakesale-query-34: list persons who are socially related to bake sale sellers
+# and show which source suggested such relation
+
+prefix c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+prefix p: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+select distinct ?g ?person ?p ?seller
+where {
+ ?person a c:Person .
+ ?seller a c:Person .
+ ?person p:social_relation ?seller.
+ ?event a c:Bake_Sale_Event .
+ ?event p:seller ?seller .
+ ?event p:product [a c:Cookie] .
+ ?p rdfs:subPropertyOf p:social_relation .
+ GRAPH ?g { {?person ?p ?seller .} UNION {?seller ?p ?person} }
+}
@@ -0,0 +1,18 @@
+# bakesale-query-36: list any two-ep relations between
+
+PREFIX c: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+PREFIX p: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+PREFIX i: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-ontology.ttl#>
+PREFIX bs-location: <http://lod-apps.googlecode.com/svn/trunk/data/bakesale/bs-location.ttl#>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX owl: <http://www.w3.org/2002/07/owl#>
+SELECT ?person ?p1 ?o ?p2 ?manager
+WHERE {
+ ?person a c:Person.
+ ?manager a c:Manager.
+ ?person ?p1 ?o .
+ ?o ?p2 ?manager .
+ FILTER ( ?person != ?o
+ && ?person != ?manager
+ && ?manager != ?o )
+}
@@ -0,0 +1,26 @@
+[The "BSD licence"]
+Copyright (c) 2007-2008 Leon, Jen-Yuan Su
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit ebe9775

Please sign in to comment.