owl

How to add rdfs:label to OWLIndividual via OWLAPI?

给你一囗甜甜゛ 提交于 2019-12-22 11:47:51
问题 I would like to add an rdfs:label to an OWLIndividual , I have the following: OWLIndividual newIndividual = factory.getOWLNamedIndividual(IRI.create(name)); OWLLiteral lbl = factory.getOWLLiteral(name); OWLAnnotation label = factory.getOWLAnnotation( factory.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()), lbl); Now, how can I associate the label to the individual? 回答1: You can associate the label the following way: OWLAxiom axiom = factory.getOWLAnnotationAssertionAxiom

How to add rdfs:label to OWLIndividual via OWLAPI?

半腔热情 提交于 2019-12-22 11:47:28
问题 I would like to add an rdfs:label to an OWLIndividual , I have the following: OWLIndividual newIndividual = factory.getOWLNamedIndividual(IRI.create(name)); OWLLiteral lbl = factory.getOWLLiteral(name); OWLAnnotation label = factory.getOWLAnnotation( factory.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()), lbl); Now, how can I associate the label to the individual? 回答1: You can associate the label the following way: OWLAxiom axiom = factory.getOWLAnnotationAssertionAxiom

How to extract RDF triples from XML file using an existing ontology?

孤街醉人 提交于 2019-12-22 06:49:03
问题 I am trying to extract RDF triples from XML files by using an existing ontology. I am using Java, and can use XPath to extract data from XML and Jena to read and write RDF documents and ontologies. How can I extract the relevant triples from the XML according to the existing ontology? 回答1: Forget about XPath to extract triples, it way easier and less problematic with Jena. You can use the interface SimpleSelector together with model.listStatements from Jena. In this example I am using

Programmatically generating OWL class hierarchy with Jena

天涯浪子 提交于 2019-12-21 23:26:47
问题 I want to programmatically generate an ontology using OWL by supplying a vector. My goal is to be able to open the produced OWL file in Protégé and make use of Jena. Input Vector The vector which i want to pass: [[layer, network layer, data link layer, physical layer], [network, computer network], [data link], [ontology, ontology extraction]]. Expected Output The output should have the following tree-like hierarchy structure: layer -network layer -data link layer -physical layer network

OWL Ontology Predicate Logic with Jena

微笑、不失礼 提交于 2019-12-21 23:23:33
问题 I'm having trouble expressing the following situation in my Ontology: Suppose I have four people voting and four votes (so there is a one-to-one mapping between vote and voter). People can either vote yes or no. If I know the outcome of three people's votes, I ought to be able to deduce the fourth person's vote. So to reiterate: John, Bob, Mary, and Carol each vote. Since there are four people there are four votes. The outcome of the vote is a tie (2 yes, and 2 no). Later on the reasoner

How to create owl file using JENA?

依然范特西╮ 提交于 2019-12-21 21:22:14
问题 I am stuck in the middle of ontology creation. I want to create an OWL file using Java which is my objective. I have created the hierarchical clusters but now I have to use those clusters in ontology creation. Thanks in advance. I have tried this so far. I got Dickinson's point. Now this is my code and I am getting an Exception as Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute URIrefs can be included in RDF/XML output: Code: 57/REQUIRED_COMPONENT

setTimeout does not work

孤街浪徒 提交于 2019-12-21 17:31:36
问题 I want to load an OWL file before executing other (visualisation-)scripts. To do this I tried everything from $(document).ready to function visualize (file) { if (!file) {setTimeout(visualize(file), 2000)} else {jQuery(function($){visFeaturePool.init(file)})}} I think it has to be possible with the setTimeout but that isn't working. I throws the error: Uncaught RangeError: Maximum call stack size exceeded, so it doesn't wait, it just recalls the visualize function untill the stack is full.

Open Source Triple store for OWL [closed]

主宰稳场 提交于 2019-12-21 06:08:36
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm new with triple stores and I need a good recommendation for an open source triple store, where I can store OWL files. Does someone have some recommendations for me? Thank you a lot! Bests M 回答1: I think 4Store would be a good choice, which is fast and stable. You can get some information from project

OWL Property Restrictions vs. SHACL

六眼飞鱼酱① 提交于 2019-12-21 04:25:20
问题 Given a choice between OWL Property Restrictions and SHACL, is there any reason to choose the OWL approach any more? Particularly with respect to cardinality constraints, I'm wondering whether SHACL is considered to supercede OWL. The syntax appears similar, to my casual inspection. I am probably missing the purpose of OWL cardinality constraints. As part of an ontology, they should facilitate inferencing (a separate concern from validation). But how do cardinality constraints facilitate

OWL restrictions - defining classes that only contains properties with a specific property value

℡╲_俬逩灬. 提交于 2019-12-21 04:14:18
问题 I'm currently playing a bit with the OWL and especially with restrictions. I'm trying to create a query that does the following: Suppose that I have a class 'Cinema' that has a property 'movies' (that contains objects of type 'Movie'). The class 'Movie' contains a property named 'genre'. Now I want to create a class ActionCinemas that only has movies with the genre 'action'. I'm really not sure how to do this. I was thinking about doing something with intersections or the cardinality but I'm