How can I parse RDF data into model? (java, jena)
I'm trying to parse RDF data and load it to a model instance. However, I don't want to read the data from a file, but rather get it through an URI via http get. What I did untik now ist this: Model model = ModelFactory.createDefaultModel(); model.read(rdfdata, null); model.write(System.out); rdfdata is the data that I received (String). But I get the following Exception: Exception in thread "main" org.apache.jena.riot.RiotNotFoundException: Not found: <?xml version="1.0" encoding="UTF-8" ?> [...] Where is the problem and how can I solve it? Is it right to just read the data into the model or do I have to do something before? Sorry for my bad english. :)
Your error message says: Not found: <?xml version="1.0" encoding="UTF-8" ?> [...] Staring at that, it appears that it's reporting that the file or URI named <?xml version="1.0" encoding="UTF-8" ?>... can't be opened. Which makes sense, since that's unlikely to be a correct file name. Check the documentation of model.read(), and in particular check what its first argument is. Also check what rdfdata is: is it the path to a file or a URI? (it looks like it's the contents of an RDF/XML file). (If this guess is right, then) Moral of the story: recall that when writing an error message, a programmer is typically at least trying to be helpful, thus ‘what is this gibberish^Werror message trying to tell me?’
How to validate XML file using an XSD locally?
XML Schema Definition Problem
How to select all elements with a specific attribute? with TinyXPath
Unraveling the dependency tree for a set of XML files using XIncludes
Combining elements from 2 lists in XSLT
Error in xslt or xml while running XSL code for factorial
flash xml slideshow
Merge similar data xml nodes using an attribute as key ( xsl )
XSLT: How to convert XML into text file with Muenchian Grouping
Remove elements from XML
Is it “bad” to store XML in a database?
XML Schema for parent-child relation and reference elements
Building an XML Schema from a Perl Hash?
Problem with My First DTD
What command should be used to get text from a line of an XML file on linux?
extending XML with unknown elements