Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KonradHoeffner/103347fbc12b5263376929a65f10cfae to your computer and use it in GitHub Desktop.
Save KonradHoeffner/103347fbc12b5263376929a65f10cfae to your computer and use it in GitHub Desktop.
select ?pair as ?BB_to_CIOX ?s1Str as ?CIOX ?pl as ?CIOX_relation ?ol as ?CIOX_object
{
{select ?CIOX_Class {GRAPH <http://www.snik.eu/ontology/ciox> { ?CIOX_Class a owl:Class.}}}
{select ?BB_Class {GRAPH <http://www.snik.eu/ontology/bb> { ?BB_Class a owl:Class.}}}
?CIOX_Class ?linkRel ?BB_Class.
filter(?linkRel=skos:exactMatch OR ?linkRel=skos:closeMatch OR ?linkRel=skos:broadMatch OR ?linkRel=skos:broader OR ?linkRel=skos:narrower OR ?linkRel=skos:narrowMatch OR ?linkRel=skos:related OR ?linkRel=skos:relatedMatch)
bind(replace(str(?linkRel),".*[/#]","") as ?linkRelStr) # don't have labels for SKOS
bind(replace(str(?CIOX_Class),".*[/#]","") as ?s1Str) # can't sample here
bind(replace(str(?BB_Class),".*[/#]","") as ?s2Str) # don't have labels for SKOS
bind(concat(?s2Str,"-",?linkRelStr,"-",?s1Str) as ?pair).
{
?CIOX_Class ?p ?o.
bind(replace(str(?p),".*[/#]","") as ?pl)
bind(replace(str(?o),".*[/#]","") as ?ol)
} UNION
{
?o ?p ?CIOX_Class.
bind(concat(replace(str(?p),".*[/#]",""),"^-1") as ?pl)
bind(replace(str(?o),".*[/#]","") as ?ol)
}
GRAPH ?g {?o a owl:Class. }
filter(?g!=<http://www.snik.eu/ontology/meta>)
filter(?p!=skos:closeMatch AND ?p!=skos:broadMatch AND ?p!=skos:broader AND ?p!=skos:narrower AND ?p!=meta:subTopClass).
filter not exists {?o a owl:Restriction.}
} order by ?pair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment