Skip to content

Instantly share code, notes, and snippets.

select ?class count(?s) as ?count
from <http://www.snik.eu/ontology>
{
graph ?g {?class a owl:Class.}
filter(?g=<http://www.snik.eu/ontology/meta>)
?s rdfs:subClassOf+ ?class.
} order by desc(?count)
select ?s ?p ?o ?domain
FROM <http://www.snik.eu/ontology/bb>
FROM <http://www.snik.eu/ontology/ob>
FROM <http://www.snik.eu/ontology/meta>
{
?p rdfs:domain ?domain.
?s ?p ?o.
filter not exists {?s rdfs:subClassOf*/a ?domain.}
}
select ?s ?p ?o ?type ?range
FROM <http://www.snik.eu/ontology/meta>
FROM <http://www.snik.eu/ontology/bb>
FROM <http://www.snik.eu/ontology/ob>
{
graph <http://www.snik.eu/ontology/meta> {?p rdfs:range ?range.}
?s ?p ?o.
?o a ?type.
filter not exists {?o a/rdfs:subClassOf* ?range.}
select distinct(?s) ?domain
FROM <http://www.snik.eu/ontology/meta>
FROM <http://www.snik.eu/ontology/bb>
FROM <http://www.snik.eu/ontology/ob>
{
graph <http://www.snik.eu/ontology/meta> {?p a owl:ObjectProperty.}
?p rdfs:domain ?domain.
?s a owl:Class.
select distinct(?s) ?range
FROM <http://www.snik.eu/ontology/meta>
FROM <http://www.snik.eu/ontology/bb>
FROM <http://www.snik.eu/ontology/ob>
{
graph <http://www.snik.eu/ontology/meta> {?p a owl:ObjectProperty.}
?p rdfs:range ?range.
?s a owl:Class.
:%s/\("[A-Z]\)\([A-Z][A-Z]*\)\([A-Z][a-z]\)/\1\L\2\u\3/c
:%s/\("[A-Z]\)\([A-Z][A-Z]*"\)/\1\L\2/c
select distinct ?targetNode ?label ?range
{
?resource a owl:Class.
filter not exists { ?targetNode a owl:Class.}
{
?resource rdfs:subClassOf ?restriction.
?restriction a owl:Restriction;
owl:onProperty ?p.
{?restriction owl:someValuesFrom ?targetNode.} UNION {?restriction owl:allValuesFrom ?targetNode.}
}
@KonradHoeffner
KonradHoeffner / select_snik_chapter_page.sparql
Created April 5, 2017 10:10
Chapters for each page. Set to Heinrich but can be used for every subontology.
select ?chapter min(xsd:integer(?page)) max(xsd:integer(?page))
from <http://www.snik.eu/ontology/he>
{
?class a owl:Class.
?class he:page ?page.
?class he:chapter ?chapter.
} order by asc(min(xsd:integer(?page)))
=WENN(ODER(LINKS(I2)="h";LINKS(I2)="");I2;"he:"&I2)
select
count(distinct(?et0)) as ?entity_types_total
count(distinct(?et1)) as ?not_used_not_updated
count(distinct(?et2)) as ?used_not_updated
count(distinct(?et3)) as ?updated_not_used
count(distinct(?et4)) as ?updated_used
?ontology
{
{
?ontology ov:defines ?et0.