Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PREFIX : <http://purl.bdrc.io/ontology/core/>
- PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
- PREFIX bdr: <http://purl.bdrc.io/resource/>
- PREFIX apf: <http://jena.apache.org/ARQ/property#>
- # find all resources with duplicate blank nodes
- SELECT ?r ?diff
- WHERE {
- {
- ?r a :Person .
- GRAPH ?r {
- SELECT (COUNT(?id) AS ?c) (COUNT(DISTINCT ?id) AS ?cd)
- WHERE {
- ?r :personName ?b .
- ?b rdfs:label ?nm .
- ?b a ?type .
- BIND (LANG(?nm) AS ?LANG)
- ?id apf:CONCAT (?type "+" ?nm "@" ?LANG) .
- }
- }
- } .
- BIND (?c - ?cd AS ?diff)
- FILTER (?diff != 0)
- } LIMIT 10
- # given a resource, ?R, report the difference of blank nodes and distinct blank nodes
- SELECT ?diff
- WHERE {
- { SELECT (COUNT(?id) AS ?c) (COUNT(DISTINCT ?id) AS ?cd)
- WHERE {
- ?R :personName ?b .
- ?b rdfs:label ?nm .
- ?b a ?type .
- BIND (LANG(?nm) AS ?LANG)
- ?id apf:CONCAT(?type "+" ?nm "@" ?LANG)
- }
- } .
- BIND (?c - ?cd AS ?diff)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement