ontology

While using Jena (java) or RDFLib (python), how should I find out whether to open the ontology as 'turtle' or 'xml'?

拥有回忆 提交于 2019-12-24 06:58:15
问题 Ontology files usually have extensions such as .owl or .rdf. I want to know when I should open ontologies with 'turtle' and when with 'xml' or other formats? Because it seems that each of them is useful for a type of format and unfortunately, it seems that people sometimes save files with the wrong extension. Here is a sample code in Python (but java is not very different either): g.parse('ontology.owl', format='turtle') So, how do I know here the turtle is the correct format? Thanks in

Extend DBpedia entity in Protege ontology

删除回忆录丶 提交于 2019-12-24 04:00:16
问题 I'm using Protege to develop an ontology that will include some things that are already described in DBpedia. Let's say I want to include a class 'Cities' and have 'Berlin' as an individual. My Berlin will have some properties the DBpedia Berlin doesn't but otherwise I'd like to 'reuse' DBpedia's Berlin. Do I need to define my own Berlin and then use rdf:seeAlso or can I somehow import DBpedia's Berlin and add some properties? 回答1: Just use the DBpedia IRI, If it's sufficient to simply talk

Pull string from RDF node

时光毁灭记忆、已成空白 提交于 2019-12-24 03:13:02
问题 Im trying to get the data in a more readable format when using a SPARQL query with Jena, however I have no idea how to extract the data in a proper way. As for now, the output is: "http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#SaucelitoCanyon" Where instead would like to just have the "SaucelitoCanyon" as a output. public JenaQuery() { String wineRegion = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" + "PREFIX owl: <http://www.w3.org/2002/07/owl#>\n" + "PREFIX xsd:

Sesame : how to remove the inference during queries?

馋奶兔 提交于 2019-12-24 02:51:30
问题 I'm looking for a solution in order to "remove" the inference during a query launched on Sesame. I must use a "Native Java Store RDF Schema" repository and I have this query : I have an instance, a NamedIndividual, and I want the uri of the class whose instance it is : SELECT DISTINCT ?uri WHERE { <http://www.semanticweb.org/ontotest#myInstance> rdf:type ?uri . FILTER (?uri rdf:type owl:Class) } The problem is that I get severals URI (whom the good URI) instead of one because of the inference

how to create aggregation on a graph from CONSTRUCT

倖福魔咒の 提交于 2019-12-24 00:54:49
问题 This is my query: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rs: <http://www.welovethesemanticweb.com/rs#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> construct { ?subject0 rs:similarityValue ?similairty0. ?subject1 rs:similarityValue ?similairty1 } WHERE { { ?subject0 ?predicate0 ?object0. rs:Impromptu_No._1 ?predicate0 ?object0. ?predicate0 rs:hasSimilarityValue ?similairty0Helper. BIND(?similairty0Helper * (4/9) AS ?similairty0) FILTER (?subject0 != rs

Reflexive property in protege

為{幸葍}努か 提交于 2019-12-24 00:35:37
问题 This is my ontology created with protege 5 . If i make cl1 and cl2 disjoint, then the ontology is being inconsistent , but if i uncheck is_friend_of reflexive , the ontology is not inconsistent any more . whats wrong with my ontology ? I want only cl1 class individuals have is_friend_of property. 回答1: Reflexivity of :is_friend_of is essential for inconsistency. Take a look at Reasoner > Inconsistent ontology explanation : I'll try to translate this explanation into (poor) English: Since :is

merge equivalent classes using owl API

余生长醉 提交于 2019-12-23 04:52:53
问题 I used OWL API to merge 2 owl files correctly. However I discovered that classes/entities withe the same name(Joshua helped to define it this way: prefixes defined such that the suffix of the classes' IRIs equal under a case insensitive string comparison) are repeated. I need to output these classes with the same names as one. any help will be appreciated. thank you in advance. 来源: https://stackoverflow.com/questions/19515464/merge-equivalent-classes-using-owl-api

Meaning of owl:hasValue?

自作多情 提交于 2019-12-23 03:33:10
问题 What is the meaning of an owl:hasValue restriction, and how is it different from owl:allValuesFrom and owl:someValuesFrom ? In an ontology, I want to write an axiom that says, “Every body that has a diploma is literate.” How can I write this? 回答1: Different types of restriction classes Consider an individual x, a class C, a property P, and another individual y. Then there are a few class expressions that it sounds like you're concerned with: someValuesFrom An individual x is an element of the

get base namespace from an OWL ontology

混江龙づ霸主 提交于 2019-12-23 02:38:08
问题 Is there a way to get the base namespace from a OWL ontology file, without using DOM or similar, but just using Jena's API? E.g., from an OWL file: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#" xmlns="http://www.owl-ontologies.com/Ontology1254827934.owl#" xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns

is it correct that a class can be an instance?

烂漫一生 提交于 2019-12-23 02:16:10
问题 In this document https://www.w3.org/TR/rdf-schema/#ch_introduction it is written: rdfs:Resource is an instance of rdfs:Class. however it is also written: This is the class of everything is this a typo? can a class be an instance ? 回答1: That's actually an interesting question. I just want to add to your comment in CaptSolo's answer: but can I define my custom classes as instances of an instance? ( i highly doubt that ) It's not so much a question of whether you "can" do something or not (at