jena

How to refresh log4j after change of the external class logging level at runtime

偶尔善良 提交于 2019-12-10 23:58:50
问题 I have some warnings which I want to disable. They comes from the org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper class. So I am using log4j and I call at rutime Logger.getLogger("org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper").setLevel(Level.OFF); but nothing happens. For that purpose I debug the problematic code and first 3 times the warn was displayed, but on the 4-th hit the level was changed. I changed the log level at the begging(in the constructor) so I suppose there is

How to map relational database to OWL?

China☆狼群 提交于 2019-12-10 19:17:46
问题 I am trying to map relational database to OWL Here are my 2 tables student(student_id,student_name,course_id) course(course_ID,course_name) +----+--------+-----------+ | id | name | course_id | +----+--------+-----------+ | 1 | Adam | 5 | | 2 | Michael| 2 | +----+--------+-----------+ +-----------+-------------+ | course_id | course_name | +-----------+-------------+ | 2 | DM | | 5 | WEBIR | +-----------+-------------+ Now course_id is the foreign key in student table referencing course_id in

Parsing RDF recursive with Jena

本秂侑毒 提交于 2019-12-10 18:54:09
问题 I'm trying to parse a RDF document recursive using Apache Jena. It consists out of datasets like this: <dcat:dataset> <dcat:Dataset rdf:about="http://url/" > <dct:description xml:lang="ca">Description</dct:description> <dct:license rdf:resource="http://creativecommons.org/licenses/by/3.0/"/> <dcat:keyword xml:lang="ca">Keyword1</dcat:keyword> <dcat:distribution> <dcat:Download> <dcat:accessURL>http:/url/</dcat:accessURL> <dct:format> <dct:IMT> <rdf:value>application/pdf</rdf:value> <rdfs

How to calculate maximum degree of a directed graph using SPARQL?

好久不见. 提交于 2019-12-10 17:09:45
问题 I have computed the indegree and outdegree of each node in the directed graph in two separate queries: SELECT ?s (COUNT(*) AS ?outdegree) { ?s ?p ?o } GROUP BY ?s ORDER BY DESC(?outdegree) SELECT ?o (COUNT(*) AS ?indegree) { ?s ?p ?o } GROUP BY ?o ORDER BY DESC(?indegree) I need to compute the maximum degree of the graph. Since max degree of a directed graph is the maximum (indegree+outdegree) value of the graph , I want to know how to combine the results of the above two queries to compute

sparql join query explanation hows its working?

帅比萌擦擦* 提交于 2019-12-10 12:35:11
问题 My query: select ?x ?z where { ?x <http://purl.uniprot.org/core/name> ?y . ?x <http://purl.uniprot.org/core/volume> ?z . ?x <http://purl.uniprot.org/core/pages> "176-186" . } I required to make custom parser for this query. When I do this query on jena model, it returns one record. Can anyone explain this query implementation? I split out this query into three parts: select ?x ?y where { ?x <http://purl.uniprot.org/core/name> ?y . } Total Records Found : 3034 select ?x ?z where { ?x <http:/

parameterized SPARQL Query

浪尽此生 提交于 2019-12-10 12:26:52
问题 I want to code a parameterized SPARQL Query in Java Jena where one of the triple in query be injected so in the code below I need to inject value as a string the pass to the class However, the SPARQL query is correct so when I replace "value" with the class name I got the right result I tried two code non of them worked No result or run time error the first code: package ontology; import org.apache.jena.iri.impl.Main; import com.hp.hpl.jena.query.ParameterizedSparqlString; import com.hp.hpl

SPARQL Query Error with OPTION(TRANSITIVE) on Jena

人盡茶涼 提交于 2019-12-10 11:03:17
问题 I have the following Query PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?type WHERE { { SELECT * WHERE { ?x rdfs:subClassOf ?type . } } OPTION (TRANSITIVE, t_distinct, t_in (?x), t_out (?type) ) . FILTER (?x = <http://dbpedia.org/ontology/Hospital>) } It works fine when i send it to Virtuoso endpoint but does not work on my Jena instance. In specific i get the following error: INFO [1] 400 Parse error: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?type WHERE { {

Jena PrefixMapping: base namespace missing when model is a named model obtained from a dataset

故事扮演 提交于 2019-12-10 10:36:11
问题 This the code I am using to load OntModel to a Dataset as a Named Model. Then I try to retrieve the PrefixMapping for the same in two different ways: public static void loadDatasetwithNamedModels(){ OntModel namedModel = null; Dataset dataset = null; dataset = TDBFactory.createDataset("./path/to/TDB_DIR"); namedModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM); dataset.begin(ReadWrite.WRITE); try{ namedModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM); FileManager

ontology with java(jena)

↘锁芯ラ 提交于 2019-12-10 10:32:33
问题 I'm doing some project which is based on ontology.I want to identify semantic of the text that has entered by user. Is there any possible way to fulfill my task dealing with ontology through jena? 回答1: Jena doesn't do Natural Language Processing. You want to look at APIs like Zemanta or OpenCalais, or tools like GATE. 回答2: You might be looking for something like this: http://nlp2rdf.org The other answers are still correct: Jena is not NLP. But with NLP2RDF you can query NLP tool output with

Jena TDB in Python?

我只是一个虾纸丫 提交于 2019-12-10 10:06:36
问题 Is it possible to run a Jena TDB database from a Python app to store a large amount of RDF data? What would be a native alternative in Python? 回答1: An alternative is to run the python code under Jython not the normal C based Python run time. Jython converts python code to the JVM language. It cannot therefore call python extensions that use C but it can call all Java classes including the Jena TDB and all pure python modules. 回答2: An alternative is to use a SPARQL endpoint such as Apache Jena