semantic-web

How save the result of reasoner FaCT++ or HermiT in Protege

喜欢而已 提交于 2019-12-22 17:56:21
问题 I'm using Protégé 4.3 and I want to save the results of the reasoner to the ontology file. When I stopped the reasoner, all results disappeared. How can I save results? 回答1: In Protégé, use File → Export inferred axioms as ontology… That should do what you're looking for. 来源: https://stackoverflow.com/questions/23079459/how-save-the-result-of-reasoner-fact-or-hermit-in-protege

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 convert model checking logic query to SPARQL query?

萝らか妹 提交于 2019-12-22 10:27:01
问题 Suppose I have the following RDF data: @prefix : <urn:ex:> :m :A "a" :m :A "b" :m :A "c" :m :B "a" :m :B "b" What SPARQL query could I use to check whether the RDF model satisfies the following logical formula? ∀x A(X) → B(x) 回答1: SPARQL doesn't have conditionals or universal quantification, but does have existentials (does anything match this?), (implicit) conjunction and negation (in the 'absence' sense). So rewrite the question: ∀x A(x) → B(x) ⇒ ∀x ¬ ( A(x) ∧ ¬ B(x) ) ⇒ ¬ ∃x A(x) ∧ ¬ B(x)

Auto Categorization of Content

孤街浪徒 提交于 2019-12-22 09:55:17
问题 I'm developing a script that extracts the messages from the message archive of a particular meetup.com group of which I'm a member - http://www.meetup.com/opencoffee/messages/archive/ The idea is to dynamically add these to a wordpress site and allow people to search messages, auto tag messages etc. The issue I have is how best to auto categorize these messages. I would welcome any thoughts and ideas of how best to go about this and what would be the most efficient way of programming this.

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

Reading a Turtle/N3 RDF File with Python

假装没事ソ 提交于 2019-12-22 04:17:29
问题 I'm trying to encode some botanical data in Turtle format, and read this data from Python using RDFLib. However, I'm having trouble, and I'm not sure if it's because my Turtle is malformed or I'm misusing RDFLib. My test data is: @PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @PREFIX p: <http://www.myplantdomain.com/plant/description> . p:description a rdfs:Property . p:name a rdfs:Property . p:language a rdfs:Property . p

Sparql query with Blank node can be complex

情到浓时终转凉″ 提交于 2019-12-21 12:41:21
问题 I read this blog article, Problems of the RDF model: Blank Nodes, and there's mentioned that using blank nodes can complicate the handling of data. Can you give me an example why using blank nodes is difficult to perform a SPARQL query? I do not understand the complexity of blank nodes. Can you explain me the meaning and semantics of an existential variable? I do not understand clearly this explanation given in the RDF Semantics Recommendation, 1.5. Blank Nodes as Existential Variables. 回答1:

Using the 'GRAPH' keyword in SPARQL to fetch remote graphs

有些话、适合烂在心里 提交于 2019-12-21 10:17:00
问题 I'm looking to use SPARQL for a relatively basic task: Given a FOAF graph, I'd like to parse the elements I find in there, get their tags (if they exist) and then, use those as new graphs from which to find information about those people. So for instance, you could imagine a simple use case where I want to run a SPARQL query to list all of my favorite foods (as per my FOAF file), and also the favorite foods of all my friends. Here is what this looks like at the moment. Note that for testing

Semantic analysis of text

匆匆过客 提交于 2019-12-21 06:39:21
问题 Which tools would you recommend to look into for semantic analysis of text? Here is my problem: I have a corpus of words (keywords, tags). I need to process sentences, input by users and find if they are semantically close to words in the corpus that I have. Any kind of suggestions (books or actual toolkits / APIs) are very welcome. Regards, 回答1: Some useful links to begin with: http://alias-i.com/lingpipe/demos/tutorial/sentiment/read-me.html http://kmandcomputing.blogspot.com/2008/06