Last active
December 19, 2015 03:19
-
-
Save wstrinz/5889227 to your computer and use it in GitHub Desktop.
Example files to test FILTER NOT EXISTS in RDF.rb
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
@prefix : <http://example.com/#> . | |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
:hr a :thing; | |
rdfs:label "Has Range"@en; | |
rdfs:range :somerange. | |
:nr a :thing; | |
rdfs:label "No Range"@en. |
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
PREFIX : <http://example.com/#> | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT ?t WHERE { | |
?t a :thing | |
FILTER NOT EXISTS{?t rdfs:range ?r} | |
} |
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
PREFIX : <http://example.com/#> | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT ?t WHERE { | |
?t a :thing | |
OPTIONAL {?t rdfs:range ?r} | |
FILTER (!bound(?r)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment