xml


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

Related Links

XML cached in local testing
Getting the child node's name of XML using XSL
What is the fastest way to add/replace a single attribute in an XML document?
Sums and Category Grouping with XSLT
create xsd schema with <any> node that contains attributes
Accessing the XML nodes in itemRenderer
Extract and format dates from xml using xslt
BlackBerry - Extract data from 3rd nesting level of xml
does xml ignores (,) OR (-)??? (xml of flash object)
what can i do with semantic web and xml and web services?
Generate random xml / web service response based on xsd / wsdl
Can a single XML schema have multiple targetNameSpaces?
Write an xml file from the specified node?
Where is the URL in the xml/xsl namespace stored?
How do you add an attribute to an xml schema element?
Concatenating XML

Categories

HOME
paraview
forms
rdbms
depth
devise
parameters
big-o
limit
mvc5
crystal-lang
trac
webix
mxgraph
libc
code-generation
onedrive-api
atlassian
libusb
capistrano3
sse
asp.net-core-webapi
microsoft-ocr
blade
ksh
springfox
cgbitmapcontext
joptionpane
easeljs
object-storage
custom-post-type
syntax-highlighting
bulletphysics
oculus
android-maps
tpm
gp
xbox
weather
glib
hibernate-validator
clickjacking
login-script
openwhisk
joomla2.5
hunspell
batching
apiary.io
magento-1.9.2.4
sql-server-ce
timing
xv6
bindingnavigator
berkeley-db-je
httr
builder
globalize
user-defined-fields
singleinstance
carrot2
oozie-coordinator
reshape
flyout
juice-ui
smartfoxserver
custom-lists
redbeard-ios
nikeplus-api
project-organization
highland.js
toran-proxy
matlab-deployment
easyrtc
trdion2011
verold
mutual-authentication
square-bracket
gd-graph
observium
poker
cuda-gdb
koken
entity-attribute-value
lr
uipagecontrol
dataform
mtu
maven-1
drupal-fivestar
software-lifecycle
fdf
information-management

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App