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 translator, button translator
xmlstarlet with files as input parameters
Import complex XML in to Excel 2016
XSLT Copy Child nodes and turn them into Parents
XML Path (XPath) condition specifically for non-numerical characters
How to connect my “lexc.exe” files to my website created via Dreamweaver?
Serializing Codefluent hierarchical entities
Spring Beans with same ids in different config files not getting correctly autowired
Error:(59) Error parsing XML: not well-formed (invalid token)
Getting all xml tags (XSLT)
Cannot find the declaration of element 'wsdl:definitions'
XML date tag is non human understandably format when SMS data is backed up
What “#.” and “#..” mean? [on hold]
how to parse xml file in python3 with xml package?
Large XML Files in VS 2017 15.1
Second update XSLT using schema-element() to find nodes defined in a schema with no namespace

Categories

HOME
eclipse
search
turing-machines
css3
jax-rs
flex
toolbox
package
replace
opendj
pyqt4
echo
iis-6
nstableheaderview
stellar.js
pybossa
3nf
android-intent
google-picker
jmp
bourbon
tosca
interpreter
onload
siri
syntax-highlighting
jquery-multiselect
appirater
tpm
errbot
deltaspike
android-maps-extensions
fiware-cygnus
wurfl
xcode7.3
opensmpp
tasm
subclipse
install.packages
pom.xml
static-cast
context-sensitive-grammar
yii2-user
reshape
type-theory
angular2-testing
omxplayer
microstation
x-tag
android-dateutils
cassia
aurora
dbamp
jaunt-api
computer-architecture
pypiserver
morton-number
include-guards
doctype
uncompress
amiga
dronekit-android
baasbox
dnssec
jquery-forms-plugin
fits
zxspectrum
gamekit
primitive-types
filesplitting
ssis-data-flow
genymotion-call
linkedin-jsapi
tinyxml
memset
radiant
vbe
inputmismatchexception
printdialog
epiceditor
dolby-audio-api
bjyauthorize
intersect
android-loadermanager
subproject
fusefabric
inkcanvas
wiimote
denied
landscape-portrait
svk
undefined-index
object-database
application-verifier
zen
wcf-instancing
xslcompiledtransform

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile