-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some reflections on SPARQL-Anything/sparql.anything#342
- Loading branch information
Showing
19 changed files
with
262 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# append | ||
This parameter tells the command line to now overwrite to an existing file but simply append to it. | ||
Here we test the behaviour in different configurations. | ||
|
||
The following use case works nicely, multiple runs append to the same file: | ||
``` | ||
fx -q construct.sparql -o out.nt --append | ||
fx -q construct.sparql -o out.nt --append | ||
fx -q construct.sparql -o out.nt --append | ||
``` | ||
|
||
This should work with .ttl as well (repeating prefixes should not be an issue): | ||
``` | ||
fx -q construct.sparql -o out.ttl --append | ||
fx -q count-triples.sparql (20) | ||
fx -q construct.sparql -o out.ttl --append | ||
fx -q count-triples.sparql (40) | ||
``` | ||
|
||
This will not work with rdf/xml, json, csv, etc... shall we alert and stop the process when this happens? | ||
|
||
## Interaction with `-v` | ||
In the following case, the system creates a file for each parameter bindings (--append has no effect): | ||
``` | ||
fx -q query.sparql -v params.csv -o out.csv --append | ||
out-1.csv | ||
out-2.csv | ||
out-3.csv | ||
out-4.csv | ||
... | ||
``` | ||
Question: should we instead append to the same file? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX xyz: <http://sparql.xyz/facade-x/data/> | ||
PREFIX fx: <http://sparql.xyz/facade-x/ns/> | ||
|
||
construct { | ||
?subject xyz:key ?key ; | ||
xyz:value ?value . | ||
} | ||
where { | ||
service <x-sparql-anything:> { | ||
fx:properties fx:location "./data.json" . | ||
[] xyz:key ?_key_int ; xyz:value ?value . | ||
} | ||
BIND (?_key_int as ?key) . | ||
BIND ( fx:entity(xyz:,"append/", ?key , "/" , STR(NOW()) ) as ?subject ) . | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX xyz: <http://sparql.xyz/facade-x/data/> | ||
PREFIX fx: <http://sparql.xyz/facade-x/ns/> | ||
|
||
select count(*) | ||
where { | ||
service <x-sparql-anything:> { | ||
fx:properties fx:location "./out.ttl" . | ||
?a ?b ?c | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{"key": 1, "value": "A"}, | ||
{"key": 2, "value": "B"}, | ||
{"key": 3, "value": "C"}, | ||
{"key": 4, "value": "D"}, | ||
{"key": 5, "value": "E"}, | ||
{"key": 6, "value": "F"}, | ||
{"key": 7, "value": "G"}, | ||
{"key": 8, "value": "H"}, | ||
{"key": 9, "value": "I"}, | ||
{"key": 10, "value": "J"} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
J |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
E |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
value | ||
I |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
_key_int,value | ||
2,B | ||
5,E | ||
6,F | ||
4,D | ||
8,H | ||
10,J | ||
9,I | ||
3,C | ||
7,G | ||
1,A | ||
_key_int,value | ||
2,B | ||
5,E | ||
6,F | ||
4,D | ||
8,H | ||
10,J | ||
9,I | ||
3,C | ||
7,G | ||
1,A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<http://sparql.xyz/facade-x/data/append/5/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "E" . | ||
<http://sparql.xyz/facade-x/data/append/5/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "5"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/10/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "J" . | ||
<http://sparql.xyz/facade-x/data/append/10/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "10"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/3/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "C" . | ||
<http://sparql.xyz/facade-x/data/append/3/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "3"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/6/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "F" . | ||
<http://sparql.xyz/facade-x/data/append/6/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "6"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/8/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "H" . | ||
<http://sparql.xyz/facade-x/data/append/8/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "8"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/1/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "A" . | ||
<http://sparql.xyz/facade-x/data/append/1/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "1"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/4/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "D" . | ||
<http://sparql.xyz/facade-x/data/append/4/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "4"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/7/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "G" . | ||
<http://sparql.xyz/facade-x/data/append/7/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "7"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/9/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "I" . | ||
<http://sparql.xyz/facade-x/data/append/9/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "9"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/2/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/value> "B" . | ||
<http://sparql.xyz/facade-x/data/append/2/2023-02-07T09:20:30.212+00:00> <http://sparql.xyz/facade-x/data/key> "2"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/9/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "I" . | ||
<http://sparql.xyz/facade-x/data/append/9/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "9"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/2/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "B" . | ||
<http://sparql.xyz/facade-x/data/append/2/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "2"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/5/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "E" . | ||
<http://sparql.xyz/facade-x/data/append/5/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "5"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/8/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "H" . | ||
<http://sparql.xyz/facade-x/data/append/8/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "8"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/10/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "J" . | ||
<http://sparql.xyz/facade-x/data/append/10/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "10"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/3/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "C" . | ||
<http://sparql.xyz/facade-x/data/append/3/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "3"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/6/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "F" . | ||
<http://sparql.xyz/facade-x/data/append/6/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "6"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/1/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "A" . | ||
<http://sparql.xyz/facade-x/data/append/1/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "1"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/4/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "D" . | ||
<http://sparql.xyz/facade-x/data/append/4/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "4"^^<http://www.w3.org/2001/XMLSchema#int> . | ||
<http://sparql.xyz/facade-x/data/append/7/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/value> "G" . | ||
<http://sparql.xyz/facade-x/data/append/7/2023-02-07T09:20:32.764+00:00> <http://sparql.xyz/facade-x/data/key> "7"^^<http://www.w3.org/2001/XMLSchema#int> . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
@prefix fx: <http://sparql.xyz/facade-x/ns/> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix xyz: <http://sparql.xyz/facade-x/data/> . | ||
|
||
<http://sparql.xyz/facade-x/data/append/5/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "5"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "E" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/8/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "8"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "H" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/10/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "10"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "J" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/1/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "1"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "A" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/3/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "3"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "C" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/6/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "6"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "F" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/9/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "9"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "I" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/4/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "4"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "D" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/7/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "7"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "G" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/2/2023-02-07T09:24:22.551+00:00> | ||
xyz:key "2"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "B" . | ||
@prefix fx: <http://sparql.xyz/facade-x/ns/> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix xyz: <http://sparql.xyz/facade-x/data/> . | ||
|
||
<http://sparql.xyz/facade-x/data/append/2/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "2"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "B" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/5/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "5"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "E" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/10/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "10"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "J" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/3/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "3"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "C" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/6/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "6"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "F" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/8/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "8"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "H" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/1/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "1"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "A" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/4/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "4"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "D" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/7/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "7"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "G" . | ||
|
||
<http://sparql.xyz/facade-x/data/append/9/2023-02-07T09:24:38.601+00:00> | ||
xyz:key "9"^^<http://www.w3.org/2001/XMLSchema#int> ; | ||
xyz:value "I" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
key | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 | ||
9 | ||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX xyz: <http://sparql.xyz/facade-x/data/> | ||
PREFIX fx: <http://sparql.xyz/facade-x/ns/> | ||
|
||
select * | ||
where { | ||
service <x-sparql-anything:> { | ||
fx:properties fx:location "./data.json" . | ||
[] xyz:key ?_key_int ; xyz:value ?value . | ||
} | ||
} |