Well the query does what it needs to do, for a given concept find the path to a
root, for example:
query:
SELECT DISTINCT ?parent
WHERE {
GRAPH ?g {
<http://purl.bioontology.org/ontology/ICD10CM/J86.0
<http://purl.bioontology.org/ontology/ICD10CM/J86.0>> rdfs:subClassOf+ ?parent .
}}
output:
parent
http://purl.bioontology.org/ontology/ICD10CM/J86
<http://purl.bioontology.org/ontology/ICD10CM/J86>
http://purl.bioontology.org/ontology/ICD10CM/J85-J86
<http://purl.bioontology.org/ontology/ICD10CM/J85-J86>
http://purl.bioontology.org/ontology/ICD10CM/J00-J99
<http://purl.bioontology.org/ontology/ICD10CM/J00-J99>
http://www.w3.org/2002/07/owl#Thing <http://www.w3.org/2002/07/owl#Thing>
It’s just that it’s really slow, so I was wondering if there was a way of
optimising this (either by some hints, or using reasoners that understand
transitivity)
Joël
> On 01 Feb 2016, at 15:42, Paul Tyson <[email protected]> wrote:
>
> I don't know that you can get such results from sparql directly. I would get
> flat list of subclass relations in xml (.srx) or Json and then process with
> xslt or JavaScript to write out class hierarchy.
>
> Regards,
> --Paul
>
> On Feb 1, 2016, at 07:05, Joël Kuiper <[email protected]
> <mailto:[email protected]>> wrote:
>
>> This message has no content.