jena

edit uri of existing resource using jena

╄→гoц情女王★ 提交于 2019-12-17 14:54:36
问题 I try to modify the uri of an existing resource of a ontology model. I thought of creating a new model, new resource (including the new desired uri) and duplicating the content of the old resource. By iterating and adding the statements doens't work properly. Is there another workaround? I'm working with jena in java and RDF/XML models. 回答1: As you've found resources are immutable. You can bring about the same effect using ResourceUtils.renameResource(resource, newName). This goes through

Giving array as parameter to a Jena built-in

£可爱£侵袭症+ 提交于 2019-12-14 03:16:58
问题 I need to create a new built-in for Jena. With this one I would like to be able to extract the minimum date from where it is. I just wondering if it is possible to give a class of datas to a built-in instead of just one parameter. Here is the bodyCall of my function : @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { System.out.println("Entra"); checkArgs(length, context); BindingEnvironment env = context.getEnv(); Node n1 = getArg(0, args, context); Node n2 =

Desktop SPARQL client for Jena (TDB)?

感情迁移 提交于 2019-12-14 01:54:03
问题 I'm working on an app that uses Jena for storage (with the TDB backend). I'm looking for something like the equivalent of Squirrel, that lets me see what's being stored, run queries etc. This seems like an obvious thing to need, but my (perhaps badly phrased) google queries aren't turning up anything promising. Any suggestions, please? I'm on XP. Even a command line tool would be helpful. 回答1: Take a look at my Store Manager tool which is part of the dotNetRDF Toolkit which I develop as part

SWRL and Virtuoso

牧云@^-^@ 提交于 2019-12-13 21:29:07
问题 I'm looking for a clear approach to use SWRL clearly in virtuoso server. For example, I designed an ontology using Protege 4.3 and I wrote the SWRL rules using Rules tab in Protege. Product(?P),hasName(?P,?N),inGroupB(?P,?B)->hasBug(?P) I uploaded my RDF data (~3GB) into Virtuoso server, along with the Ontology schema. I tried to recall the data that is supposed to be inferred based on the Rules in the ontology but the query return empty results. Example of the SPARQL query that it should

Localhost error Fuseki-service Ubuntu

删除回忆录丶 提交于 2019-12-13 18:34:08
问题 We've installed Fuseki2 as a service at a Ubuntu-server and its works fine: sudo service fuseki status * Fuseki is running with pid: 915 I now can go to http://xyz:30303/manage.html (where xyz it the ip-address of the server) and it shows the Manage datasets screen, but nothing happens when I click add new dataset . Console browser (and also http://xyz:3030/$/server ) gives " Failed to load resource: the server responded with a status of 403 (Access denied : only localhost access allowed) "

Should queries with URIs like http://pt.dbpedia.org/resource/.. be different from the ones with URIs like http://dbpedia.org/resource/..?

两盒软妹~` 提交于 2019-12-13 17:20:54
问题 I'm making that SPARQL query: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label WHERE { <http://pt.dbpedia.org/resource/Brasil> rdfs:label ?label.} and I don't get any results for ?text . I checked that URI on my browser and found the rdfs:label property there. Is that problem caused by the URI form http://pt.dbpedia.org/ ? I've already used the same query with IRIs starting with http://dbpedia.org/resource/ , e.g.,

RDF/XML how to define RDFS classes,subclasses and link them as a type

你离开我真会死。 提交于 2019-12-13 17:17:30
问题 How can we define classes and sub classes in Jena and add them as type of other resources after? I use Java,Jena and RDF/XML notation. I want to create something like: <rdfs:Class rdf:about="http://www.help.me/NS/Classname"/> <rdfs:Class rdf:about="http://www.help.me/NS/Subclassname"> <rdfs:subClassOf rdf:resource="http://www.help.me/NS/Classname"/> </rdfs:Class> And after: linking a resource to a subclass: <rdf:Description rdf:about="http://www.help.me/NS/NewResource"> <rdf:type rdf:resource

Using Jena Api in Java Web… Unknown Exception

泪湿孤枕 提交于 2019-12-13 16:04:26
问题 Did anyone encountered this exception while using Jena in Java Web Application... Please Kindly help me .. Here is my servlet code package com.mycompany.servlet; import java.io.IOException; import java.util.Iterator; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http

How can I programmatically compute path length using Jena RDF/Ontology API?

别等时光非礼了梦想. 提交于 2019-12-13 15:53:50
问题 I have an RDF Graph with only one relationship(RDFS.subClassOf or is-a) between all the classes. The 'size' of each class is equal to the total number of its subclasses. The 'size' of each RDFS.subClassOf property is 0.5 if it is connecting from a class with fewer total number of subclasses and 1 if it is connecting from class with large total number of subclasses to class with less total number of subclasses. I want to perform an arithmetic sum of all the sizes of each semantic component

Disable apache.http.wire DEBUG logs

ぐ巨炮叔叔 提交于 2019-12-13 15:27:07
问题 I'm using Travis CI with my github repo(java project). One of my tests gets data from Dbpedia using SPARQL and Jena. It causes many records i get to be printed in the log into Travis output and thus Travis fails. A log example for instance: 14:52:58.756 [main] DEBUG org.apache.http.wire - http-outgoing-1 << " { "pname": { "type": "literal", "xml:lang": "en", "value": "Yuen Poovarawan" }[0x9], "photo": { "type": "uri", "value": "http://commons.wikimedia.org /wiki/Special:FilePath/Yuen