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

displaying markers with google map from a xml file
NotePad++ RegEx for Changing A Lot Of XREFs
I am finding difficult to write a regular expression for a location element in xml schema
InvalidAttrNameOrValue response from SAML request
Select data with XSLT from XMI and UML tags in xml
DTD Element Assistance [duplicate]
Can XML element have '$' sign in the value?
Xml deserializer error only on Windows Server 2008 R2
I am trying to populate checkbox true/false values in a windows form application from an xml document
Embedded schematron not working in an XML document with a namespace
Untar tar.gz file using perl
ASP processing of text file data: FSO vs. XML/DOM
Hierarchical configuration file in perl
how to put tag a href=“javascript:void(0);” onclick=“function()” inside cdata
Excel Ribbon - Enable Filter button for protected worksheet
Converting date string in XML using XSLT

Categories

HOME
dns
object
numbers
battery
serialization
jelastic
switch-statement
cq5
cakephp-3.4
web-hosting
square
babeljs
computer-science
bing-maps
minecraft-forge
shared-libraries
renjin
firefox-addon
red5
smartclient
breadth-first-search
inno-download-plugin
qliksense
comparator
xunit
mount
windows-server-2003
testcomplete
custom-controls
gitlab-api
volatile
database-comparison
erb
jett
dsx-desktop
browser-extension
reason
xcode7.3
git-rewrite-history
railstutorial.org
loading
c9.io
xv6
vaadin-charts
getchar
launchctl
x-ray
context-switch
opengl-4
template-toolkit
winusb
adafruit
spring-cloud-feign
windows-azure-queues
wso2developerstudio
kango-framework
kiosk
grass
asyncdisplaykit
sapi
iokit
rate-limiting
pax-exam
mod-proxy
canvg
omnifaces
entity-framework-4.3
diff3
phpldapadmin
bcache
qtwebengine
webmatrix-3
structuremap3
contrast
teaspoon
rickshaw
raygun
ss7
verold
spring-remoting
mt4j
http-patch
model-driven-development
tlf
swfobject
saleslogix
mapping-by-code
usertype
clrstoredprocedure
glui
wordprocessingml
leader

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