 |
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
|
|
|

June 10th, 2008, 02:40 AM
|
Authorized User
|
|
Join Date: Jun 2008
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Convert XML to RDF
Hello,
Does anyone know how to convert from XML to RDF?
I looked for, and I found out that we have to use XSL to convert from XML to RDF.
Any idea about this case?
Thank you
|

June 10th, 2008, 03:00 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
RDF is XML so you there maybe no change involved, otherwise you need to show the XML source and how it maps to the RDF you need.
--
Joe ( Microsoft MVP - XML)
|

June 10th, 2008, 03:02 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
Since RDF is often expressed in XML, one answer might be "do nothing". In fact, the answer is, it depends on the nature of the input XML and the nature of the output RDF that you want to produce. XSLT might well be a suitable language to express the transformation, but your question is a bit like asking "how do I convert data into documents?"
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|

June 10th, 2008, 03:43 AM
|
Authorized User
|
|
Join Date: Jun 2008
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The goal of my purpose actually is to search the "keyword" inside the document using RDF. What I use RDF, because by using RDF, the searching will be more semantically/more specific.
I know, RDF is similar like XML. But, I think RDF syntax is predefined and XML is not.
I read in w3schools.com, it just explain how to change from XML to XHTML/HTML...
Here is my XML:
<form>
<description>
<desc_id>048/26/SMD/HRD/9/00</desc_id>
<title>Kebijakan2</title>
<dates>3/21/1999</dates>
<author>Smart Co</author>
<file_name>Policy2</file_name>
<type>pdf</type>
<category>memorandum</category>
<sub_cat1>tidak_berlaku</sub_cat1>
<sub_cat2>1983</sub_cat2>
</description>
</form>
|

June 10th, 2008, 03:51 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
You seem a little confused in your terminology here.
XML is a data format that defines how a document can be written.
RDF is a specific type of document, written in XML, that must follow other rules.
So you are trying to transform one XML document format into another XML document format.
We don't know RDF off the top of our heads, so if you have your input document above, what do you want your output document to look like.
/- Sam Judson : Wrox Technical Editor -/
|

June 10th, 2008, 04:05 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
RDF may be designed to capture rich semantics, but if you create it automatically from something else, there's no way that what you generate will have more semantic content than what you started with.
I would say you're much better off querying the original XML.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|

June 10th, 2008, 05:33 AM
|
Authorized User
|
|
Join Date: Jun 2008
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
So, what is the conclusion? I feel confuse. Does actually any possibilities to change from XML to RDF?
I have already create the XML file... This is my thesis topic for bachelor. And I can not change the title anymore. The title is"Implementation information Retrieval using RDF" So, I must use RDF.
|

June 10th, 2008, 05:38 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
As RDF IS XML then yes, it is perfectly possible to convert your XML document above into RDF.
However as I said - we don't know RDF, so if you want any help at all in writing an XSLT stylsheet to perform the transformation you will have to show us what you want the output (i.e. your RDF document) to look like.
/- Sam Judson : Wrox Technical Editor -/
|

June 10th, 2008, 05:45 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
>I have already create the XML file... This is my thesis topic for bachelor. And I can not change the title anymore. The title is"Implementation information Retrieval using RDF" So, I must use RDF.
Wonderful! If it's any consolation, similar things happen in commercial projects all the time. The requirements for the project say that it will use a relational database (or even a specific vendor's product!), so it ends up using one, despite mounting evidence during the design phase that better solutions are available. It's a very bad idea to commit to particular technologies too early; and a good project title would describe the objectives (=benefits to users), not the means of achieving them.
Well, if you want to do a project using RDF, go ahead. You'll find plenty of enthusiasts for it - but not here! So far, you haven't given a justification for using RDF that I would accept as valid.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|

July 1st, 2008, 11:05 AM
|
Registered User
|
|
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
Here is a hope valid reason to justify why someone need to do that (convert XML to RDF). I have all the data (obviously) available in XML. However, I build an ontology in Protege and I need to test it on real data. Protege uses OWL (ie RDF as I understand). Thus I have to convert the data into RDF format to actually import the ontology into it afterwards.
I realize your patriotic feelings and liability to XML, however there are cases when such conversion it has to be done (unless someone suggest something smarter). Your reply sounds like you know how to do it but not willing to help because there is no "a justification for using RDF that I would accept as valid" for you. So, please, Mr Michael Kay, if you can help, please do. Anyone else is also welcome.
Thank you for your help.
|
|
 |