-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from e-e-e/sparql
Add SPARQL query interface
- Loading branch information
Showing
18 changed files
with
367 additions
and
5 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
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
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
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
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,7 @@ | ||
@prefix foaf: <http://xmlns.com/foaf/0.1/> . | ||
|
||
_:a foaf:givenname "Alice" . | ||
_:a foaf:family_name "Hacker" . | ||
|
||
_:b foaf:firstname "Bob" . | ||
_:b foaf:surname "Hacker" . |
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,25 @@ | ||
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . | ||
@prefix sn: <http://www.snee.com/hr/> . | ||
|
||
sn:emp1 vcard:given-name "Heidi" . | ||
sn:emp1 vcard:family-name "Smith" . | ||
sn:emp1 vcard:title "CEO" . | ||
sn:emp1 sn:hireDate "2015-01-13" . | ||
sn:emp1 sn:completedOrientation "2015-01-30" . | ||
|
||
sn:emp2 vcard:given-name "John" . | ||
sn:emp2 vcard:family-name "Smith" . | ||
sn:emp2 sn:hireDate "2015-01-28" . | ||
sn:emp2 vcard:title "Engineer" . | ||
sn:emp2 sn:completedOrientation "2015-01-30" . | ||
sn:emp2 sn:completedOrientation "2015-03-15" . | ||
|
||
sn:emp3 vcard:given-name "Francis" . | ||
sn:emp3 vcard:family-name "Jones" . | ||
sn:emp3 sn:hireDate "2015-02-13" . | ||
sn:emp3 vcard:title "Vice President" . | ||
|
||
sn:emp4 vcard:given-name "Jane" . | ||
sn:emp4 vcard:family-name "Berger" . | ||
sn:emp4 sn:hireDate "1000-03-10" . | ||
sn:emp4 vcard:title "Sales" . |
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,7 @@ | ||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> | ||
|
||
SELECT ?person | ||
WHERE | ||
{ | ||
?person vcard:family-name "Smith" . | ||
} |
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 vcard: <http://www.w3.org/2006/vcard/ns#> | ||
PREFIX sn: <http://www.snee.com/hr/> | ||
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
|
||
CONSTRUCT { | ||
?person rdf:type foaf:Person . | ||
?person foaf:givenName ?givenName . | ||
?person foaf:familyName ?familyName . | ||
?person foaf:name ?fullName . | ||
} | ||
WHERE { | ||
?person vcard:given-name ?givenName . | ||
?person vcard:family-name ?familyName . | ||
BIND(concat(?givenName," ",?familyName) AS ?fullName) | ||
} |
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,8 @@ | ||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> | ||
|
||
SELECT ?person ?givenName | ||
WHERE | ||
{ | ||
?person vcard:family-name "Smith" . | ||
?person vcard:given-name ?givenName . | ||
} |
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,10 @@ | ||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> | ||
PREFIX sn: <http://www.snee.com/hr/> | ||
|
||
SELECT ?givenName ?familyName ?hireDate | ||
WHERE | ||
{ | ||
?person vcard:given-name ?givenName . | ||
?person vcard:family-name ?familyName . | ||
?person sn:hireDate ?hireDate . | ||
} |
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 vcard: <http://www.w3.org/2006/vcard/ns#> | ||
PREFIX sn: <http://www.snee.com/hr/> | ||
|
||
SELECT ?givenName ?familyName ?hireDate | ||
WHERE | ||
{ | ||
?person vcard:given-name ?givenName . | ||
?person vcard:family-name ?familyName . | ||
?person sn:hireDate ?hireDate . | ||
FILTER(?hireDate < "2015-03-01") | ||
} |
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,10 @@ | ||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> | ||
PREFIX sn: <http://www.snee.com/hr/> | ||
|
||
SELECT ?givenName ?familyName ?oDate | ||
WHERE | ||
{ | ||
?person vcard:given-name ?givenName . | ||
?person vcard:family-name ?familyName . | ||
?person sn:completedOrientation ?oDate . | ||
} |
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,10 @@ | ||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> | ||
PREFIX sn: <http://www.snee.com/hr/> | ||
|
||
SELECT ?givenName ?familyName ?oDate | ||
WHERE | ||
{ | ||
?person vcard:given-name ?givenName . | ||
?person vcard:family-name ?familyName . | ||
OPTIONAL { ?person sn:completedOrientation ?oDate . } | ||
} |
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,10 @@ | ||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> | ||
PREFIX sn: <http://www.snee.com/hr/> | ||
|
||
SELECT ?givenName ?familyName | ||
WHERE | ||
{ | ||
?person vcard:given-name ?givenName . | ||
?person vcard:family-name ?familyName . | ||
NOT EXISTS { ?person sn:completedOrientation ?oDate . } | ||
} |
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,6 @@ | ||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> | ||
PREFIX sn: <http://www.snee.com/hr/> | ||
|
||
SELECT ?givenName ?familyName ?someVariable WHERE { ?person | ||
vcard:given-name ?givenName . ?person vcard:family-name ?familyName . | ||
BIND("some value" AS ?someVariable) } |
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,9 @@ | ||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> | ||
PREFIX sn: <http://www.snee.com/hr/> | ||
|
||
SELECT ?givenName ?familyName ?fullName | ||
WHERE { | ||
?person vcard:given-name ?givenName . | ||
?person vcard:family-name ?familyName . | ||
BIND(concat(?givenName," ",?familyName) AS ?fullName) | ||
} |
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 foaf: <http://xmlns.com/foaf/0.1/> | ||
PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#> | ||
|
||
CONSTRUCT { ?x vcard:N _:v . | ||
_:v vcard:givenName ?gname . | ||
_:v vcard:familyName ?fname } | ||
WHERE | ||
{ | ||
{ ?x foaf:firstname ?gname } UNION { ?x foaf:givenname ?gname } . | ||
{ ?x foaf:surname ?fname } UNION { ?x foaf:family_name ?fname } . | ||
} |
Oops, something went wrong.