XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Posttop
john smithSubject: RDF/OWL Transformation - Backtracking Parent Classes ?
Author: john smith
Date: 25 Nov 2006 02:54 PM
I am trying to display the below file using xslt as a tree structure;

------------------------------------------------------------------
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#">

<owl:Class rdf:about="#Grandad">
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">old</rdfs:comment>
</owl:Class>

<owl:Class rdf:about="#Dad">
<rdfs:subClassOf>
<owl:Class rdf:about="#Grandad"/>
</rdfs:subClassOf>
</owl:Class>

<owl:Class rdf:ID="Son">
<rdfs:subClassOf rdf:resource="#Dad"/>
</owl:Class>

<owl:Class rdf:ID="Daughter">
<rdfs:subClassOf rdf:resource="#Dad"/>
</owl:Class>

</rdf:RDF>

------------------------------------------------------------


However as you can see the relationship is part of each element, as opposed to having the element nested within each other based on their relationship.

If the relationships were going downwards it would be easy, i.e. The "Grandad" class would state what classes are inheriting from it, however as inheritance and classes don't work this way, i don't know how these relationships can be converted to a hierarchy structure such as:
<Grandad>
<Dad>
<Son>
</Son>
<Daughter>
</Daughter>
</Dad>
</Grandad>

How can I display this using xsl to show the hierarchy of classes ?

Grandad( Dad( Son(), Daughter() ) )

I am not too concerned with the form of presentation, only how to backtrack the Classes based on the relationship.
For example to be able to create something like the below:
<div>
Grandad
<div>
Dad
<div>
Son
</div>
<div>
Daughter
</div>
</div>
</div>



 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.