Skip to content

Instantly share code, notes, and snippets.

@KonradHoeffner
Last active November 7, 2016 14:34
Show Gist options
  • Save KonradHoeffner/4804d65ccff47e46d470447a73b25069 to your computer and use it in GitHub Desktop.
Save KonradHoeffner/4804d65ccff47e46d470447a73b25069 to your computer and use it in GitHub Desktop.
select ?pair ?s ?p ?c
{
{select ?s1 ?ps ?s2 {?s1 a owl:Class. ?s2 a owl:Class. ?s1 ?ps ?s2. filter(?ps=skos:closeMatch OR ?ps=skos:broadMatch)}}
bind(replace(replace(replace(concat(?s1,"-",?ps,"-",?s2),"http[^-]*skos/core#","skos/"),"http[^-]*ontology/",""),"/",":") as ?pair).
?s ?p ?c.
filter(?p!=skos:closeMatch AND ?p!=skos:broadMatch).
?c a owl:Class.
filter not exists {?c a owl:Restriction.}
{
?s a owl:Class.
filter(?s=?s1)
}
union
{
?s a owl:Class.
filter(?s=?s2)
}
} order by ?pair, ?s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment