jena


Jena adds path/url to URIs

谁都会走 提交于 2020-01-16 18:41:50
问题 I just started working with RDF and Jena. I got a RDF model which I want to read, modify and write out again. Assume my model file is located at http://xyz/model.ttl and contains an element with URI "someURI". When I do Model model = ModelFactory.createDefaultModel(); model.read("http://xyz/model.ttl", "", "TURTLE"); model.write(System.out, "TURTLE"); the URI in the output changes from "someURI" to http://xyz/someURI . When I read the model from the local filesystem, the URI changes to file:/

Jena adds path/url to URIs

霸气de小男生 提交于 2020-01-16 18:41:13
问题 I just started working with RDF and Jena. I got a RDF model which I want to read, modify and write out again. Assume my model file is located at http://xyz/model.ttl and contains an element with URI "someURI". When I do Model model = ModelFactory.createDefaultModel(); model.read("http://xyz/model.ttl", "", "TURTLE"); model.write(System.out, "TURTLE"); the URI in the output changes from "someURI" to http://xyz/someURI . When I read the model from the local filesystem, the URI changes to file:/

sparql group by and order by: not ordered

浪子不回头ぞ 提交于 2020-01-15 10:48:11
问题 I follow up on query where the schema.org database is used to find the number of children of a class - as a simpler database than my application. I want to get the names of the children concatenated in alphabetic order. The query prefix schema: <http://schema.org/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?child (group_concat (?string) as ?strings) where { ?child rdfs:subClassOf schema:Event . ?grandchild rdfs:subClassOf ?child . bind (strafter(str(?grandchild), "http:/

XML to RDF : using JENA GRDDL

佐手、 提交于 2020-01-15 10:44:12
问题 I want to transform xml files to RDF. I think that JENA GRDDL can be used ,but I don't know how it works ! and I did not found any examples ! can you help me please to start using this API or show me any possible solutions ! 回答1: You can transform XML files to RDF using XSLT, typically targeting RDF/XML (see, e.g., Using jena for creating RDF from XMl file). Jena can then read the resulting file. You can even streamline this process and parse the result of the XSLT transformation directly

Jena Sparql Error java.lang.Integer

坚强是说给别人听的谎言 提交于 2020-01-15 08:08:22
问题 I have the following code: RestClient client = new RestClient("http://localhost:8080/scheduler.core/rest/services/discoverSensors"); client.AddParam("userID", "keith@acrosslimits.com"); client.AddParam("longitude", "4.3512725830078125"); client.AddParam("latitude", "50.84761359783461"); client.AddParam("radius", "15.0"); client.AddHeader("accept", "application/xml"); try { client.Execute(RestClient.RequestMethod.GET); } catch (Exception e) { e.printStackTrace(); } String response = client

UNION and intersection using SPARQL queries

末鹿安然 提交于 2020-01-15 07:22:06
问题 I am converting user-defined-queries into SPARQL. For example, when user says, "abc", it means give me all nodes of a given type which have some attribute named "abc". As an extension of this, if user says, "abc or (pqr and lmn)", I need to find all nodes of a given type for which some attribute is "abc or (pqr and lmn)". Following is the query I have come up with: SELECT DISTINCT ?node, ?type WHERE { { ?node a ?type . FILTER ( ?type != <sometype>) } { { ?node ?reln0 ?obj0 . FILTER ( regex

How do you create a Fuseki SPARQL server using the Apache Jena Java API?

回眸只為那壹抹淺笑 提交于 2020-01-15 04:10:09
问题 I am trying to create a Fuseki SPARQL server on my machine. The documentation on the Jena website describes how to create such a server from the command-line, here: http://jena.apache.org/documentation/serving_data/. I am looking for a way of creating and initializing such a server just using the Jena Java API. I have looked over the Jena API but have not made any progress in working out how to proceed. Has anyone done this before? 回答1: Yes this is possible but it is not how Fuseki was

Jena parsing issue for freebase RDF dump (Jan 2014)

末鹿安然 提交于 2020-01-11 06:07:49
问题 I am trying to parse freebase dump file freebase-rdf-2014-01-12-00-00.gz (25 GB) using Jena. There has been many issues reported by Jena regarding bad data. Example - 150.0 not valid,true and false values not valid These issues I have resolved by adding double quotes around decimal and true/false in dump file. However issues are still being reported by Jena.(current - org.apache.jena.riot.RiotException: [line: 161083, col: 110] Illegal object: [MINUS]) Is there any way to pre process this

Jena parsing issue for freebase RDF dump (Jan 2014)

我与影子孤独终老i 提交于 2020-01-11 06:07:07
问题 I am trying to parse freebase dump file freebase-rdf-2014-01-12-00-00.gz (25 GB) using Jena. There has been many issues reported by Jena regarding bad data. Example - 150.0 not valid,true and false values not valid These issues I have resolved by adding double quotes around decimal and true/false in dump file. However issues are still being reported by Jena.(current - org.apache.jena.riot.RiotException: [line: 161083, col: 110] Illegal object: [MINUS]) Is there any way to pre process this

when i Use MySQL Database System with Jena2,i got java.lang.NoSuchMethodError

非 Y 不嫁゛ 提交于 2020-01-07 06:24:27
问题 here is my code import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.sql.SQLException; import com.hp.hpl.jena.db.DBConnection; import com.hp.hpl.jena.db.IDBConnection; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.ModelMaker; public class myontoly { public static

工具导航Map