Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate page and chapter statements #296

Closed
KonradHoeffner opened this issue Apr 16, 2019 · 8 comments
Closed

Investigate page and chapter statements #296

KonradHoeffner opened this issue Apr 16, 2019 · 8 comments
Assignees
Milestone

Comments

@KonradHoeffner
Copy link
Collaborator

We only seem to have sparse page and chapter data. Investigate how many we have and in which form and if we lost any through the remodels.

@KonradHoeffner KonradHoeffner added this to the 0.9 milestone Apr 16, 2019
@KonradHoeffner KonradHoeffner self-assigned this Apr 16, 2019
@KonradHoeffner
Copy link
Collaborator Author

KonradHoeffner commented Apr 16, 2019

In the old bb.rdf from the repository (last update: 2017-08-01), there are only 494 occurrences of page, see grep "page>[^<]" bb.rdf | wc -l. This is because the SPARQL query also counts empty page statements, which should be removed. In the meantime, here is the count for nonempty pages:

relation class count
http://www.snik.eu/ontology/it4it/page http://www.w3.org/2002/07/owl#NamedIndividual 7
http://www.snik.eu/ontology/he/page http://www.w3.org/2002/07/owl#Class 1927
http://www.snik.eu/ontology/it4it/page http://www.w3.org/2002/07/owl#Class 18
http://xmlns.com/foaf/0.1/homepage http://www.w3.org/2002/07/owl#Ontology 7
http://www.snik.eu/ontology/bb/page http://www.w3.org/2002/07/owl#Class 482
http://www.snik.eu/ontology/he/page http://www.w3.org/2002/07/owl#Axiom 197
http://www.snik.eu/ontology/ob/page http://www.w3.org/2002/07/owl#Class 1
http://www.snik.eu/ontology/bb/page http://www.w3.org/2002/07/owl#ObjectProperty 1
http://www.snik.eu/ontology/he/page http://www.w3.org/2002/07/owl#ObjectProperty 7
http://www.snik.eu/ontology/bb/page http://www.w3.org/2002/07/owl#DatatypeProperty 19
select ?p as ?relation ?c as ?class count(distinct * ) as ?count
{
 ?x ?p ?y.
 ?x a ?c.
 filter(?y!="").
 filter(REGEX(STR(?p),"page"))
} group by ?p ?c

And for comparison the empty ones:

relation class count
http://www.snik.eu/ontology/bb/page http://www.w3.org/2002/07/owl#Class 642
http://www.snik.eu/ontology/ob/page http://www.w3.org/2002/07/owl#DatatypeProperty 1
http://www.snik.eu/ontology/ob/page http://www.w3.org/2002/07/owl#Class 773
http://www.snik.eu/ontology/bb/page http://www.w3.org/2002/07/owl#DatatypeProperty 2

@KonradHoeffner
Copy link
Collaborator Author

There don't seem to be any pages for triples, just for classes and relations. Maybe they are mistakenly placed in the relations? How many are there at maximum for a single subject?

select ?x count(?y)
{
 ?x bb:page ?y.
 filter(?y!="").
} order by desc(count(?y))

Result: At most two per subject, which looks fine.

Next Step: Look at the old extraction table of bb to find out if there are page statements that are missing now.

@KonradHoeffner
Copy link
Collaborator Author

@KonradHoeffner
Copy link
Collaborator Author

Are the axiom still bound to valid subjects and objects?

Get an overview via:

select *
from sniko:bb
from sniko:ob
{
 ?x bb:TripelPage|ob:TripelPage ?page.
 ?x ?p ?o.
}
x page p o
nodeID://b207595 "136"^^http://www.w3.org/2001/XMLSchema#string http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Axiom
nodeID://b207612 "155, 164"^^http://www.w3.org/2001/XMLSchema#string http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Axiom
nodeID://b207617 "130"^^http://www.w3.org/2001/XMLSchema#string http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Axiom
nodeID://b207622 "137"^^http://www.w3.org/2001/XMLSchema#string http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Axiom
nodeID://b207624 "137"^^http://www.w3.org/2001/XMLSchema#string http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Axiom
nodeID://b207636 "127"^^http://www.w3.org/2001/XMLSchema#string http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Axiom
...

Hard to see, rewrite blank nodes to so that they are in the namespace of their subontology and can be viewed via LodView.

@KonradHoeffner
Copy link
Collaborator Author

KonradHoeffner commented Apr 17, 2019

rename blank nodes to "real" nodes

blank nodes in subject position

sparql
select ?g count(*)
{
 graph ?g
 {
  ?x ?p ?o.
  FILTER(REGEX(STR(?x),"nodeID://"))
 }
} group by ?g
gANY callret-1ANY
http://www.w3.org/2002/07/owl# 6
http://www.snik.eu/ontology/ciox 200
http://www.snik.eu/ontology/meta 6
http://www.snik.eu/ontology/bb 18092
http://www.w3.org/2004/02/skos/core# 6
http://www.snik.eu/ontology/it4it 27
http://www.snik.eu/ontology/ob 24368

blank nodes in object position

select ?g count(*)
{
 graph ?g
 {
  ?x ?p ?o.
  FILTER(REGEX(STR(?o),"nodeID://"))
 }
} group by ?g
gANY callret-1ANY
http://www.w3.org/2002/07/owl# 3
http://www.snik.eu/ontology/meta 2
http://www.w3.org/2004/02/skos/core# 3
http://www.snik.eu/ontology/it4it 3
http://www.snik.eu/ontology/ob 2338
http://www.snik.eu/ontology/bb 1139

@KonradHoeffner
Copy link
Collaborator Author

KonradHoeffner commented Apr 17, 2019

Rename bb subject

SPARQL
with <http://www.snik.eu/ontology/bb>
delete
{
  ?x ?p ?o.
}
insert
{
  ?y ?p ?o.
}
where
{
  ?x ?p ?o.
  FILTER(REGEX(STR(?x),"nodeID://"))
  BIND(IRI(REPLACE(STR(?x),"nodeID://b","http://www.snik.eu/ontology/bb/blank")) as ?y).
}

Analogously ob
Modify <http://www.snik.eu/ontology/ob>, delete 24368 (or less) and insert 24368 (or less) triples -- done
Modify <http://www.snik.eu/ontology/ciox>, delete 200 (or less) and insert 200 (or less) triples -- done

rename bb object

SPARQL
with <http://www.snik.eu/ontology/bb>
delete
{
  ?x ?p ?o.
}
insert
{
  ?x ?p ?y.
}
where
{
  ?x ?p ?o.
  FILTER(REGEX(STR(?o),"nodeID://"))
  BIND(IRI(REPLACE(STR(?o),"nodeID://b","http://www.snik.eu/ontology/bb/blank")) as ?y).
}

Modify <http://www.snik.eu/ontology/bb>, delete 1139 (or less) and insert 1139 (or less) triples -- done
Modify <http://www.snik.eu/ontology/ob>, delete 2338 (or less) and insert 2338 (or less) triples -- done

@KonradHoeffner
Copy link
Collaborator Author

investigate whether the axioms source and targets still exist

select *
{
 ?x owl:annotatedSource|owl:annotatedTarget ?o.
 MINUS {?o a ?something.}
}

Result: 16 missing, so it seems to work in general. Separate issue: #297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant