问题
I want to transform xml files to RDF. I think that JENA GRDDL can be used ,but I don't know how it works ! and I did not found any examples ! can you help me please to start using this API or show me any possible solutions !
回答1:
You can transform XML files to RDF using XSLT, typically targeting RDF/XML (see, e.g., Using jena for creating RDF from XMl file). Jena can then read the resulting file.
You can even streamline this process and parse the result of the XSLT transformation directly using a SAXResult
and SAX2Model.
GRDDL (see the excellent primer) standardises this procedure. It provides a way to discover an XSLT transformation for a given XML document: either directly using grddl:transformation
, or indirectly for a class of documents using xml namespace schemas or html profiles. (see the GRDDL spec for the details)
So GRDDL doesn't really help you as such: you still need to write the transformation for your files.
来源:https://stackoverflow.com/questions/15808478/xml-to-rdf-using-jena-grddl