Skip to content

Commit

Permalink
new examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofstetter Benjamin (extern) committed Nov 5, 2024
1 parent 2379685 commit 5fbb3de
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 618,817 deletions.
2 changes: 1 addition & 1 deletion doc/00_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ You can provide a file path or a glob pattern.

Here are a few patterns:
```sparql
# [endpoint=./rdf/curia.nt]
# [endpoint=./rdf/a.nt]
```
or
```sparql
Expand Down
12 changes: 9 additions & 3 deletions samples/multi-endpoiont.sparqlbook
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/curia.nt]\n\nPREFIX schema: <http://schema.org/>\nPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX xsd:<http://www.w3.org/2001/XMLSchema#>\n\nDESCRIBE <https://politics.ld.admin.ch/person/1257>",
"value": "# [endpoint=./rdf/a.ttl]\nPREFIX ex: <http://example.org/>\n \nDESCRIBE ex:A ",
"metadata": {}
},
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/*]\n# error will be shown \nPREFIX schema: <http://schema.org/>\nPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX xsd:<http://www.w3.org/2001/XMLSchema#>\n\nDESCRIBE <https://politics.ld.admin.ch/person/1257>",
"value": "# [endpoint=./rdf/*]\n# error will be shown \nPREFIX ex: <http://example.org/>\n\n\nDESCRIBE ex:A ",
"metadata": {}
},
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/curia.nt]\n# [endpoint=./rdf/curia.nt]\n# [endpoint=./rdf/curia.nt]\n# [endpoint=./rdf/curia.nt]\nPREFIX schema: <http://schema.org/>\nPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX xsd:<http://www.w3.org/2001/XMLSchema#>\n\nDESCRIBE <https://politics.ld.admin.ch/person/1257>",
"value": "# [endpoint=./rdf/a.ttl]\n# [endpoint=./rdf/a.ttl]\n# [endpoint=./rdf/a.ttl]\n# [endpoint=./rdf/a.ttl]\nPREFIX ex: <http://example.org/>\n\n\nDESCRIBE ex:A ",
"metadata": {}
},
{
Expand All @@ -29,6 +29,12 @@
"value": "# [endpoint=./rdf/a.ttl]\n# [endpoint=./rdf/b.ttl]\n\nSELECT * WHERE {\n ?s ?p ?o\n}",
"metadata": {}
},
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/a.rdf]\n# [endpoint=./rdf/b.ttl]\n\nSELECT * WHERE {\n ?s ?p ?o\n}",
"metadata": {}
},
{
"kind": 2,
"language": "sparql",
Expand Down
14 changes: 4 additions & 10 deletions samples/oxi-test.sparqlbook
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,25 @@
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/curia.ttl]\n\n\nSELECT ?opti ?s ?p ?o\nWHERE {\n ?s ?p ?o .\n optional {\n ?s <https://foo.ch/bar/> ?opti .\n }\n} LIMIT 10",
"value": "# [endpoint=./rdf/a.ttl]\n\nPREFIX ex: <http://example.org/>\n\nSELECT ?s ?p ?o ?opti \nWHERE {\n BIND (ex:A as ?s)\n ?s ?p ?o .\n optional {\n ?s <https://foo.ch/bar/> ?opti .\n }\n} LIMIT 10",
"metadata": {}
},
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/curia.ttl]\n\nASK WHERE {\n \n ?s <https://foo.ch/bar/> ?opti .\n \n}",
"value": "# [endpoint=./rdf/a.ttl]\n\nASK WHERE {\n \n ?s <https://foo.ch/bar/> ?opti .\n \n}",
"metadata": {}
},
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/curia.ttl]\n\n\nCONSTRUCT {\n ?s ?p ?o .\n}\nWHERE {\n ?s ?p ?o .\n \n} LIMIT 10",
"value": "# [endpoint=./rdf/a.ttl]\n\n\nCONSTRUCT {\n ?s ?p ?o .\n}\nWHERE {\n ?s ?p ?o .\n \n} LIMIT 10",
"metadata": {}
},
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/curia.ttl]\n\n\nDESCRIBE <https://politics.ld.admin.ch/person/1122>",
"metadata": {}
},
{
"kind": 1,
"language": "markdown",
"value": "",
"value": "# [endpoint=./rdf/a.ttl]\n\n\nDESCRIBE <http://example.org/A>\n",
"metadata": {}
}
]
14 changes: 3 additions & 11 deletions samples/queries/z-external-query.rq
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@
#
# change
# windows change
PREFIX gont: <https://gont.ch/>
PREFIX schema: <http://schema.org/>
SELECT ?name ?abbr ?date WHERE {
{
?canton a gont:Canton;
gont:cantonAbbreviation ?abbr ;
gont:date ?date ;
gont:longName ?name .
} UNION {
gont:Canton ?p ?o .
}

SELECT ?p ?o WHERE {
<https://agriculture.ld.admin.ch/fsvo/animal-disease> ?p ?o .
}
28 changes: 3 additions & 25 deletions samples/query-from-rdf-file.sparqlbook
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{
"kind": 2,
"language": "sparql",
"value": "CONSTRUCT {\n ?s ?p ?o .\n} WHERE {\n BIND(<https://politics.ld.admin.ch/person/1257> as ?s)\n ?s ?p ?o .\n} ",
"value": "CONSTRUCT {\n ?s ?p ?o .\n} WHERE {\n BIND(<https://agriculture.ld.admin.ch/fsvo/animal-disease> as ?s)\n ?s ?p ?o .\n} ",
"metadata": {}
},
{
Expand All @@ -44,37 +44,15 @@
{
"kind": 2,
"language": "sparql",
"value": "# [endpoint=./rdf/curia.nt]\nPREFIX schema: <http://schema.org/>\nPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX xsd:<http://www.w3.org/2001/XMLSchema#>\n\nDESCRIBE <https://politics.ld.admin.ch/person/1257>",
"value": "# [endpoint=./rdf/a.ttl]\n\nDESCRIBE <http://example.org/A>",
"metadata": {}
},
{
"kind": 2,
"language": "sparql",
"value": "# from file queries/z-external-query.rq\n\n\n# [endpoint=https://lindas.admin.ch/query]\n#\n# change \n# windows change\nPREFIX gont: <https://gont.ch/>\nPREFIX schema: <http://schema.org/>\nSELECT ?name ?abbr ?date WHERE {\n { \n ?canton a gont:Canton;\n gont:cantonAbbreviation ?abbr ;\n gont:date ?date ;\n gont:longName ?name . \n } UNION {\n gont:Canton ?p ?o .\n }\n} \n",
"value": "# from file queries/z-external-query.rq\n\n\n# [endpoint=https://lindas.admin.ch/query]\n#\n# change \n# windows change\n\nSELECT ?p ?o WHERE {\n <https://agriculture.ld.admin.ch/fsvo/animal-disease> ?p ?o .\n} \n",
"metadata": {
"file": "queries/z-external-query.rq"
}
},
{
"kind": 2,
"language": "sparql",
"value": "# from file queries/z-external-query-win.rq\n# [endpoint=https://lindas.admin.ch/query]\n\nPREFIX gont: <https://gont.ch/>\nPREFIX schema: <http://schema.org/>\nSELECT ?name ?abbr ?date WHERE {\n { \n ?canton a gont:Canton;\n gont:cantonAbbreviation ?abbr ;\n gont:date ?date ;\n gont:longName ?name . \n } UNION {\n gont:Canton ?p ?o .\n }\n} \n",
"metadata": {
"file": "queries/z-external-query-win.rq"
}
},
{
"kind": 2,
"language": "sparql",
"value": "# from file queries/z-external-query-win.rq\n# [endpoint=https://lindas.admin.ch/query]\n\nPREFIX gont: <https://gont.ch/>\nPREFIX schema: <http://schema.org/>\nSELECT ?name ?abbr ?date WHERE {\n { \n ?canton a gont:Canton;\n gont:cantonAbbreviation ?abbr ;\n gont:date ?date ;\n gont:longName ?name . \n } UNION {\n gont:Canton ?p ?o .\n }\n} \n",
"metadata": {
"file": "queries/z-external-query-win.rq"
}
},
{
"kind": 2,
"language": "sparql",
"value": "",
"metadata": {}
}
]
9 changes: 9 additions & 0 deletions samples/rdf/a.rdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:schema="http://schema.org/">

<rdf:Description rdf:about="http://example.org/A">
<rdf:type rdf:resource="http://example.org/Class1"/>
</rdf:Description>
</rdf:RDF>
Loading

0 comments on commit 5fbb3de

Please sign in to comment.