rdf

URI of an RDF resource in Jena model

ぃ、小莉子 提交于 2019-12-12 05:25:22
问题 While I create resources in the model and print the URI, I get the correct namespace. For instance, the URI is http://www.somesite1.com/rdfdump/resources/resourceid-1 However, when I export the resources to an RDF file (link to the file) and I import it, I get the resource URI pointing to the physical location of the file in the disk such as file:///D:/somefolder/resources/resourceid-1 I am using com.hp.hpl.jena.rdf.model.Model in conjunction with com.hp.hpl.jena.ontology.OntModel . The RDF

Sparql - How to constuct RDF by selecting MAX values of objects grouped by properties?

家住魔仙堡 提交于 2019-12-12 03:42:54
问题 sorry for the irrevelant title, I'm French and I didn't know how to expose my problem. I think the best way to explain it is with an example. I have some RDF sets like this one: prefix p: <http://localhost/rdf/> p:set p:hasTitle p:val1 . p:set p:hasTitle p:val2 . p:set p:hasAuthor p:val3 . p:set p:hasAuthor p:val4 . p:val1 p:hasValue "Harry Peter" . p:val1 p:hasScore 0.30 . p:val2 p:hasValue "Harry Potter" . p:val2 p:hasScore 0.90 . p:val3 p:hasValue "J. K. Rowling". p:val3 p:hasScore 0.90 .

General class Axioms

a 夏天 提交于 2019-12-12 03:19:09
问题 OWL AXIOM expressions: Given : owl:class sport Output: in addition to the existing owl:object properties i want to add the owl:object property player with the value Peter to every instance from type owl:class sport. That means that every individual from type owl:class sport should have this object property inherited with the value Peter. My first thought was to express it with a general class axiom. Here i am not really sure whether this a) possible and b) better to do it with a SPARQL update

How to express this individual in Description logic

ε祈祈猫儿з 提交于 2019-12-12 03:19:08
问题 I want to express this in dl, Protege view. How can I express the individual inclusive gateway1 which is from type inclusiveGateway? {inclusiveGateway} ≡ (inclusivegateway1) (inslusiveGateway2) name: inclusiveGateway id: inclusiveGateway1 gatewaydirection: unspec if a object property exists: flowsinto: task1 Couldn't find an example how to do it for this case, just some equivalanceRelation for different classes, eg. Man≡ Person 回答1: The problem that you mostly got no answer is that your

No output for rule in Jena using generic rule reasoner

[亡魂溺海] 提交于 2019-12-12 02:56:09
问题 I created an ontology in Protege and imported that ontology in Eclipse using Jena. I have written rules in rule file and want the output of the rules to be displayed in Jena but its not showing output. Program is getting executed without errors. The details of ontology are Thing Children 0-12Months 1-3Years 4-7Years 7-12Years Toys Bikes Building_Blocks Dolls Skates Stuffed_toys Added one datatype property playWith domain children and range Toys whose inverse is playedBy Added four inviduals

Writing nested rdf:Description elements in RDF/XML with Jena

随声附和 提交于 2019-12-12 02:49:40
问题 I would like to have a file like this: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://stackoverflow.com/q/24084473/1281433/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:j.0="http://stackoverflow.com/q/24084473/1281433/relations/"> <rdf:Property rdf:about="http://stackoverflow.com/q/24084473/1281433/Regione"> <rdfs:label>Regione</rdfs:label> </rdf:Property> <rdf:Property rdf:about="http://stackoverflow.com/q/24084473/1281433/Nome"> <rdfs:label>Nome<

SPARQL query using rdf:ID returns no results

吃可爱长大的小学妹 提交于 2019-12-12 02:37:39
问题 I have an owl file and I am trying to run queries on it but not getting any results please some one help me to figure it out and explain basic querying public static void main(String[] args) { String filename="H:/Samson_study/nodeTest/hRESTS-TC3/ontology/ApothecaryOntology.owl"; Model model=ModelFactory.createDefaultModel(); OntModel model1=ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM,model); try { File file=new File(filename); FileInputStream reader=new FileInputStream(file);

SPARQL query RDF ontology

筅森魡賤 提交于 2019-12-12 01:52:59
问题 Im trying this sparql query, but Im having trouble to find out whats wrong. I would like to take all the receipes that has those ingredients or less. ie: receipe 1: Tomato receipe 2: Tomato and salt receipe 3: Tomato, salt, onion. And I have the following query: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX rec:<http://www.receta

Recursive object property in owl

☆樱花仙子☆ 提交于 2019-12-12 00:13:59
问题 Can we model an object property to be recursive in owl? If not is there any work around? E.g. I want to define workflow as a class in owl. Task and getSubTasks are class and object property in my ontology respectively. I want to model workflow as combination of task and getSubTasks fetched recursively. 回答1: It sounds like you want to declare that getSubTasks , or some superproperty of it, is a transitive property, which you can do in OWL. E.g., if you have a class Task , a property

Obtaining start and end date from a DBPedia CareerStation

天涯浪子 提交于 2019-12-11 23:35:59
问题 I am trying to write a query that will return my all CareerStation objects that are associated with Arsenal FC. Then I want to be able to get the start and end dates of these CareerStations, currently I can only get the start date. It may be that only the start date is in the DB but this doesn't make much sense to me. Also I would like to know if there is a way of formatting the date so to remove the parts that aren't the actual year. Thanks in advance for any pointers. PREFIX p: <http:/