Nagore, you'd have a better chance of response if you started a new thread instead of replying to a random one with a question.
On Tue, Dec 10, 2013 at 3:48 PM, Nagore Salaberria <[email protected]> wrote: > Hello, > > First of all congratulations for the great work you have done with the JENA > API .My name is Nagore and I'm developing my thesis and for that I need to > make a prototype that enables me to read my rdf files and SPARQL queries > performed on them . So I thought using Jena and when I drove to make my > first test, I ran into the following error: > > *Exception in thread " main" org.apache.jena.riot.RiotException : Invalid > byte 1 of 1 - byte UTF -8 sequence .* > *at org.apache.jena.riot.system.ErrorHandlerFactory $ ErrorHandlerStd.fatal > ( ErrorHandlerFactory.java : 136 )* > *org.apache.jena.riot.lang.LangRDFXML at $ ErrorHandlerBridge.fatalError ( > LangRDFXML.java : 243 )* > *at com.hp.hpl.jena.rdf.arp.impl.ARPSaxErrorHandler.fatalError ( > ARPSaxErrorHandler.java : 48 )* > *at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.warning ( XMLHandler.java : > 209)* > *at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.fatalError ( XMLHandler.java : > 239 )* > *org.apache.xerces.util.ErrorHandlerWrapper.fatalError at ( Unknown Source > )* > *org.apache.xerces.impl.XMLErrorReporter.reportError at ( Unknown Source )* > *org.apache.xerces.impl.XMLErrorReporter.reportError at ( Unknown Source )* > *org.apache.xerces.impl.XMLDocumentFragmentScannerImpl at $ > FragmentContentDispatcher.dispatch ( Unknown Source )* > *org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument at ( > Unknown Source )* > *org.apache.xerces.parsers.DTDConfiguration.parse at ( Unknown Source )* > *org.apache.xerces.parsers.DTDConfiguration.parse at ( Unknown Source )* > *at org.apache.xerces.parsers.XMLParser.parse ( Unknown Source )* > *at org.apache.xerces.parsers.AbstractSAXParser.parse ( Unknown Source )* > *at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse ( RDFXMLParser.java : > 151 )* > *at com.hp.hpl.jena.rdf.arp.ARP.load ( ARP.java : 119 )* > *at org.apache.jena.riot.lang.LangRDFXML.parse ( LangRDFXML.java : 142 )* > *org.apache.jena.riot.RDFParserRegistry at $ ReaderRIOTFactoryImpl $ 1.read > ( RDFParserRegistry.java : 142 )* > *at org.apache.jena.riot.RDFDataMgr.process ( RDFDataMgr.java : 818)* > *at org.apache.jena.riot.RDFDataMgr.parse ( RDFDataMgr.java : 679 )* > *at org.apache.jena.riot.RDFDataMgr.read ( RDFDataMgr.java : 211 )* > *at org.apache.jena.riot.RDFDataMgr.read ( RDFDataMgr.java : 184 )* > *at org.apache.jena.riot.RDFDataMgr.read ( RDFDataMgr.java : 122 )* > *at org.apache.jena.riot.RDFDataMgr.read ( RDFDataMgr.java : 113 )* > *at org.apache.jena.riot.adapters.RDFReaderRIOT.read ( RDFReaderRIOT.java : > 77 )* > *at com.hp.hpl.jena.rdf.model.impl.ModelCom.read ( ModelCom.java : 247 )* > *at com.hp.hpl.jena.util.FileManager.readModelWorker ( FileManager.java : > 395 )* > *at com.hp.hpl.jena.util.FileManager.loadModelWorker ( FileManager.java : > 326 )* > *at com.hp.hpl.jena.util.FileManager.loadModel ( FileManager.java : 278 )* > *at tutorial.prueba.sparqlTest ( prueba.java : 38 )* > *at tutorial.prueba.main ( prueba.java : 30 )* > > > This would be my code: > > > > *package tutorial ;* > > *javax.management.Query import ;* > *org.apache.jena.iri.impl.Main import ;* > *import com.hp.hpl.jena * . ;* > *com.hp.hpl.jena.query.QueryExecution import ;* > *com.hp.hpl.jena.query.QueryExecutionFactory import ;* > *com.hp.hpl.jena.query.QueryFactory import ;* > *com.hp.hpl.jena.query.QuerySolution import ;* > *com.hp.hpl.jena.query.ResultSet import ;* > *com.hp.hpl.jena.rdf.model.Literal import ;* > *com.hp.hpl.jena.rdf.model.Model import ;* > *com.hp.hpl.jena.util.FileManager import ;* > > > *public class Test {* > > > > > *public static void main ( String args [ ] )* > *{* > > *sparqlTest ( ) ;* > *}* > > > *static void sparqlTest ()* > *{* > > *FileManager.get () addLocatorClassLoader ( Main.class.getClassLoader ()). > ;* > *FileManager.get Model model = () loadModel ( > " http://localhost/loadtest.rdf <http://localhost/loadtest.rdf> ") ;* > > *String querys =* > *" PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns# > <http://www.w3.org/1999/02/22-rdf-syntax-ns#>> " +* > *" PREFIX gr: <htto://purl.org/goodrelations/v1# > <http://purl.org/goodrelations/v1#>> " +* > *"SELECT * WHERE { " +* > *"? p to gr: offering " +* > *" ? p gr : name x ? " +* > *" }";* > > *com.hp.hpl.jena.query.Query QueryFactory.create q = ( querys );* > *QueryExecution QueryExecutionFactory.create exe = ( q , model );* > > *try {* > *ResultSet result = exe.execSelect ();* > *while ( result.hasNext ())* > *{* > > *QuerySolution result.nextSolution sun = ();* > *Sol.getLiteral name = Literal ("x" );* > *System.out.println ();* > *}* > *finally { }* > *exe.close ( ) ;* > *}* > *}* > > *}* > > > and my rdf file : > > *<? xml version = "1.0 " encoding = "UTF -8 ">* > *< rdf : RDF xmlns: g = " http://purl.org/goodrelations/v1 > <http://purl.org/goodrelations/v1> #" xmlns: xsd = > " http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema> #" > xmlns: rdf = " http:/ / www.w3.org/1999/02/22-rdf-syntax-ns > <http://www.w3.org/1999/02/22-rdf-syntax-ns> # " >* > > *< g : offering* > *<gr:condition> available with different options < / g : condition>* > > *<gr:hasPriceSpecification>* > *<gr:UnitPriceSpecification>* > *<gr:hasCurrencyValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float > <http://www.w3.org/2001/XMLSchema#float>"> € 279.66 < / gr: > hasCurrencyValue >* > *< / gr: UnitPriceSpecification >* > *< / gr: hasPriceSpecification >* > *< g : image / >* > *<gr:name> bicycle training roller Roller Elite AL13 < / gr: name>* > *< / gr: offering>* > > *< g : offering* > *<gr:condition> available with different options < / g : condition>* > > *<gr:hasPriceSpecification>* > *<gr:UnitPriceSpecification>* > *<gr:hasCurrencyValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float > <http://www.w3.org/2001/XMLSchema#float>"> € 444.23 < / gr: > hasCurrencyValue >* > *< / gr: UnitPriceSpecification >* > *< / gr: hasPriceSpecification >* > *< g : image / >* > *<gr:name> bicycle training roller Arion Digital Elite Roller < / gr: name>* > *< / gr: offering>* > *< / rdf : RDF >* > > > > > I hope your answer, > > Regards, > > > 2013/12/10 Martynas Jusevičius <[email protected]> > >> Hey, >> >> after upgrade to 2.11.0 I get this exception during Graph Store >> Protocol request: >> >> org.apache.jena.atlas.web.HttpException: 411 - Length Required >> org.apache.jena.riot.web.HttpOp.exec(HttpOp.java:1020) >> org.apache.jena.riot.web.HttpOp.execHttpPost(HttpOp.java:633) >> org.apache.jena.riot.web.HttpOp.execHttpPost(HttpOp.java:601) >> >> org.apache.jena.web.DatasetGraphAccessorHTTP.doPost(DatasetGraphAccessorHTTP.java:184) >> >> org.apache.jena.web.DatasetGraphAccessorHTTP.httpPost(DatasetGraphAccessorHTTP.java:179) >> org.apache.jena.web.DatasetAdapter.add(DatasetAdapter.java:98) >> org.graphity.server.util.DataManager.addModel(DataManager.java:440) >> >> Has something changed wrt to Content-Length? I guess I'll need to >> extend DatasetGraphAccessorHTTP... Or is there an easier way to work >> around this? >> >> Martynas >> graphityhq.com >> > > > > -- > Nagore Salaberria<[email protected]>
