piero
SPARQL endpoint:
Query
SELECT DISTINCT ?c1 as ?id1 REPLACE(REPLACE(REPLACE(STR(?c1), piero:, "piero:"), kegg:, "kegg:"), ids:, "ids:") as ?name1 ?size1 ?c2 as ?id2 REPLACE(REPLACE(REPLACE(STR(?c2), piero:, "piero:"), kegg:, "kegg:"), ids:, "ids:") as ?name2 ?size2 ?link_size ?link_type FROM
WHERE { ?c1 a owl:Class . ?c2 a owl:Class . { SELECT ?c1 ?c2 count(?o1) as ?link_size ?link_type WHERE{ ?o1 a ?c1 . ?o2 a ?c2 . { SELECT DISTINCT ?o1 ?o2 ?link_type WHERE { ?p2 a owl:ObjectProperty . ?o1 ?p2 ?o2 . BIND("1" AS ?link_type) } }UNION{ SELECT DISTINCT ?o1 ?o2 ?link_type WHERE { ?o1 owl:equivalentTo ?o2 . BIND("2" AS ?link_type) } } } } { SELECT ?c3 COUNT(?o3) AS ?size1 WHERE { ?c3 a owl:Class . ?o3 a ?c3 . } } FILTER(?c3 = ?c1) { SELECT ?c4 COUNT(?o4) AS ?size2 WHERE { ?c4 a owl:Class . ?o4 a ?c4 . } } FILTER(?c4 = ?c2) }