Named Graphs - statnett/Talk2PowerSystem GitHub Wiki
WORK IN PROGRESS. See https://github.com/Sveino/Inst4CIM-KG/issues/164
This page explores the usage of named graphs in Nordic44 and its implications regarding data duplication and reasoning
Counts per named graph
PREFIX dct: <http://purl.org/dc/terms/>
select ?g ?name (count(*) as ?c) where {
graph ?g {
?s ?p ?o .
}
optional {?g dct:conformsTo ?name .}
} group by ?g ?name order by desc(?c)
Duplication across graphs
PREFIX dct: <http://purl.org/dc/terms/>
select ?s ?p ?o (count(*) as ?c) where {
graph ?g {
?s ?p ?o .
}
} group by ?s ?p ?o having (?c>1) order by desc(?c)
Triples exist in up to 3 named graphs, all of them are ?x rdf:type ?o
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
select ?s ?p ?o (count(*) as ?c) where {
graph ?g {
?s ?p ?o .
filter(!sameterm(?p,rdf:type))
}
} group by ?s ?p ?o having (?c>1) order by desc(?c)
nordic44_mono
repo
Created repo with single graph for flattening duplicates from nordic44 size flattened: 145260 size original w/ inference: 102326 explicit 145260 inferred = 247586
query for copyying uisng internal federation
insert {
?s ?p ?o .
}
where {
service <repository:nordic44> {
?s ?p ?o .
}
}
overcount issues
There is no overcount for duplcated triples across graphs in GDB.
PREFIX cim: <https://cim.ucaiug.io/ns#>
select (count(*) as ?c)
{
bind(<http://www.Statnett.no/IGM/Nordic44_CGM#_2dd903cd-bdfb-11e5-94fa-c8f73332c8f4> as ?s)
graph ?g {
?s a cim:Terminal .
}
}
?c = 3
PREFIX cim: <https://cim.ucaiug.io/ns#>
select (count(*) as ?c)
{
bind(<http://www.Statnett.no/IGM/Nordic44_CGM#_2dd903cd-bdfb-11e5-94fa-c8f73332c8f4> as ?s)
?s a cim:Terminal .
}
?c = 1