semantic-web

Problems querying OWL ontology through OWL API

巧了我就是萌 提交于 2019-12-12 04:39:48
问题 I have the ontology used in the OWL API examples. private static final String KOALA = "<?xml version=\"1.0\"?>\n" + "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns=\"http://protege.stanford.edu/plugins/owl/owl-library/koala.owl#\" xml:base=\"http://protege.stanford.edu/plugins/owl/owl-library/koala.owl\">\n" + " <owl:Ontology rdf:about=\"\"/>\n" + " <owl:Class rdf:ID=\

Compare two strings and find how closely they are related by meaning

点点圈 提交于 2019-12-12 03:38:31
问题 Problem: I have two strings, say, "Billie Jean" and "Thriller". I need to programmatically compare them and find how closely they are related. Those are both songs of the same artist, hence, they should give a higher score (probability, percentage etc) than say, "Brad Pitt" and "Jamaican Farewell". One way of doing this is an open source Java tool named WikipediaMiner which compares using the Wikipedia data dump, checking links, descriptions etc. Question: Please suggest a better alternative,

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);

Why dbpedia result is not consistant

淺唱寂寞╮ 提交于 2019-12-12 02:08:48
问题 I'm executing the below SPARQL query PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?resource WHERE { ?resource a <http://dbpedia.org/ontology/Place> . {?resource rdfs:label 'Paris'@en.} UNION { ?resource rdfs:label 'France'@en.} } I'm executing this here. Sometimes I am getting required result and sometimes it returns 502 error ( I get the message that website is under maintenance.....) Can you please let me know why result is not consistent and how can I avoid this? Also

Sparql Insert Exception : SPARQLWrapper.SPARQLExceptions.QueryBadFormed

房东的猫 提交于 2019-12-11 22:07:46
问题 I have been having this weird issue, I am trying to insert into a virtuoso graph using SPARQLWrapper library in python. I am able to insert a triple via the browser based endpoint at localhost:8890\sparql , but when I try the same query via my python SparqlWrapper it throws the below error: SPARQLWrapper.SPARQLExceptions.QueryBadFormed: QueryBadFormed: a bad request has been sent to the endpoint, probably the sparql query is bad formed. I feel there is something wrong at configuration end,

Select a property value from dbpedia resource with SPARQL

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 19:49:44
问题 i'm trying to use SPARQL query on DBpedia. I can retrieve all information about a resource with this query: PREFIX db: <http://dbpedia.org/resource/ PREFIX prop: <http://dbpedia.org/property/> PREFIX onto: <http://dbpedia.org/ontology/> SELECT ?property ?value WHERE { db:Luciano_Ligabue ?property ?value }; Now I want to retrieve the value of just one property such as dbpedia-owl: birthDate. I'm trying in different way, but i can't retrieve the information needed. Can someone help me, please?

Convert a statement with adjective in RDF triple

蹲街弑〆低调 提交于 2019-12-11 13:54:48
问题 How adjective are treated in a semantic web RDF triples? For example, how to traslate in RDF triples the following statement ? Bob has a new car Maybe: subject: bob predicate: has object: car plus subject: car predicate: is object: new and link the two RDF (first object with second subject)? Is this the way ? Can someone suggest related documentation ? 回答1: That's right. Rather naive, but your model makes perfect sense. How much depth, clarity, and interoperability you want to embody will

Connecting Linkedmdb and DBpedia via federated SPARQL queries

眉间皱痕 提交于 2019-12-11 13:49:39
问题 I ran the following query and got the data for movies and their corresponding DBpedia URI from linkedmdb. SELECT ?film ?label ?dbpediaLink WHERE { ?film rdf:type movie:film . ?film rdfs:label ?label . ?film owl:sameAs ?dbpediaLink FILTER(regex(str(?dbpediaLink), "dbpedia", "i")) } LIMIT 100 I want to get the category for these movies from DBpedia using the ?dbpediaLink URI. Also, I need to get the value of the dcterms:subject property for the movie from DBpedia. I am not able to understand

Sesame repository not being updated using INSERT despite no error

你说的曾经没有我的故事 提交于 2019-12-11 13:43:34
问题 I am trying to update a Sesame repository with data from dbpedia. I have the following query: PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX : <http://dbpedia.org/resource/> PREFIX dbpedia2: <http://dbpedia.org/property/> PREFIX dbpedia: <http:/