1 / 6

Jena (Apache)

Jena (Apache). olivier.corby@inria.fr. Jena. HP, Apache http://jena.apache.org/ RDF Triple Store In memory or in database Fuseki SPARQL endpoint. Load. Model model = ModelFactory.createDefaultModel (); InputStream in = FileManager.get (). open(" data.ttl ");

simeon
Télécharger la présentation

Jena (Apache)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jena (Apache) olivier.corby@inria.fr

  2. Jena • HP, Apache • http://jena.apache.org/ • RDF Triple Store • In memory or in database • Fuseki SPARQL endpoint

  3. Load Model model = ModelFactory.createDefaultModel(); InputStreamin = FileManager.get().open("data.ttl"); model.read(in, null, "TTL");

  4. Query String queryString = "select * where { ?x ?p ?y }"; Queryquery = QueryFactory.create(queryString); QueryExecutionqe = QueryExecutionFactory.create(query, model); ResultSetresults = qe.execSelect(); ResultSetFormatter.output(results, ResultsFormat.FMT_RS_XML);

  5. Result for (; results.hasNext();) { QuerySolutionsol = results.next(); Literallit = sol.getLiteral("y"); System.out.println("y: " + lit.getString()); }

  6. Update String q = "prefixfoaf: <http://foaf.org/> " + "create graph foaf:g1 ;" + "insert data {graph foaf:g1 {" + <John> foaf:knows <Jim>, <James>}}"; Model model = ModelFactory.createDefaultModel(); Datasetds = DatasetFactory.create(model); UpdateAction.parseExecute(q, ds) ;

More Related