Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2008, 11:29 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

OK, you're getting closer to explaining the problem.

Now it just boils down to the usual technique: show us an example of your input XML and your output XML (because RDF is indeed XML), explain how they relate, and we can point you in the direction of writing a transformation to convert one to the other.

I'm sorry if my previous reply was a little sarcastic. But I did ask why you wanted to use RDF, and the only reason you could give was that it was part of the title of your thesis, which I thought was a little bit back-to-front.


Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 2nd, 2008, 08:24 AM
Registered User
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you.

Please note, I'm a different person from the one who posted first post (deean who has a project with ultimate goal to convert formats as i understand). Anyway...

My project need convertion for the data I have in XML format which looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<PatientList xmlns:ns0="allvanc:patient">
    <Patient metabric_cl_id= "MB-VC-4000">
        <grade>2</grade>
        <size>20</size>
        <hist1>84803</hist1>
        <hist1_desc>Mucinous adenocarcinoma</hist1_desc>
        <hist2></hist2>
        <hist3></hist3>
        <group>1</group>
    </Patient>

etc. for different entries (patient as an attribute i guess)

These data have to be opened in Protege, in which I build an ontology for these data. If successfully converted and open in Protege these data, I intend to import ontology into it (dont know how yet but that is what is suggested in tutorials) and query the data. All this (protege and ontology) is necessary because the data are in different formats from different hospitals, i.e. have different schemas. If convert them to RDF and read in Protege and then import ontology, it would be possible to query across all 5 different databases.

The ontology files (and I suspect the format the data should have to be able to open it as RDF file in Protege) look like this:

<?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="http://www.owl-ontologies.com/Ontology1214764090.owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
  xml:base="http://www.owl-ontologies.com/Ontology1214764090.owl">
  <owl:Ontology rdf:about=""/>
  <owl:Class rdf:ID="Invasive_Ductal_and_Invasive_Lobular">
    <rdfs:subClassOf>
      <owl:Class rdf:ID="Invasive_Lobular_Carcinoma"/>
    </rdfs:subClassOf>
    <rdfs:subClassOf>
      <owl:Class rdf:ID="Invasive_Ductal_Carcinoma"/>
    </rdfs:subClassOf>

etc. closing with </rdf:RDF>

This is owl (rdf) file generated by Protege when building an ontology in gui.

I use Protege for a month and never used xml before. Thus this task is not trivial for me.

Thank you very much to anyone who can help. Your help will be very much appreciated.

Olga

 
Old July 2nd, 2008, 09:19 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I can't see any relationship between the contents of your input and output files, so it's hard to see how to convert one to the other.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 2nd, 2008, 10:23 AM
Registered User
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well if I knew exactly how the answer should look like, I just use it, right?

 
Old July 2nd, 2008, 02:39 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

> Well if I knew exactly how the answer should look like, I just use it, right?

If you don't know what output you want your XSLT transformation to produce, then XSLT experts aren't going to be able to help you write it. You need an RDF expert, and you've already been told they don't hang around here. When you know what output you want to produce, we can help you produce it.

It's like going to a station ticket office and saying you don't know where you want to go, but can they help you get there? XSLT is a great way of getting from A to B, but it doesn't help you choose your destination.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 11th, 2008, 03:32 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I just saw an announcement of

http://kwarc.info/projects/krextor/

which might be of interest

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 15th, 2010, 11:42 AM
Registered User
 
Join Date: May 2010
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

A transformation from XML to RDF can be accomplished by the xml2rdf.xsl XSLT transformation, which can be found at:

http://www.gac-grid.de/project-produ...e/XML2RDF.html

Further details are explained in:

http://arxiv.org/abs/0906.2291

Cheers

Frank
The Following User Says Thank You to fbreitling For This Useful Post:
 
Old June 22nd, 2011, 06:10 AM
Registered User
 
Join Date: Jun 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tripliser - XML to RDF conversion library & CLI

You may want to try this new library/command-line tool

http://daverog.github.com/tripliser/

It maps XML to RDF using XPath to extract the data.

For the source XML:

<person id="bart-simpson" friends="http://van-houten.name/milhouse">
<name>Bart Simpson</name>
</person>


The mappings could look like this...

<resource query="person">
<about prepend="http://people.name/" append="#person" query="@id"/>
<properties>
<property name="rdf:type" resource="true" value="foaf:name"/>
<property name="foaf:name" query="name" />
<property name="foaf:knows" query="@friends" />
</properties>
</resource>
 
Old May 7th, 2013, 03:31 AM
Registered User
 
Join Date: May 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default X2R Converter

Try this

http://x2r.aut.ac.nz

Brimountain





Similar Threads
Thread Thread Starter Forum Replies Last Post
The advantage of XML rather than RDF deean XML 2 June 17th, 2008 01:20 PM
Convert 1 big XML to multiple smaller XML victorcorey XSLT 1 March 20th, 2008 05:59 AM
Convert XML to XML template question bonekrusher XSLT 3 July 12th, 2007 07:47 AM
convert XML to XMl - Another Namespace question bonekrusher XSLT 2 July 10th, 2007 07:32 AM
Trouble reading RDF einarhansen Classic ASP XML 0 November 25th, 2003 03:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.