semantic-web

Is it possible to return relationships between two objects in SPARQL?

北城余情 提交于 2019-12-13 04:39:06
问题 I am a beginner in SPARQL and I would like to know if it is possible to return relationships between two objects. For example I would like to write a SPARQL query which returns the relationship between Thierry Henry and Arsenal in dbpedia. 回答1: SELECT ?relationship WHERE { <http://dbpedia.org/resource/Thierry_Henry> ?relationship <http://dbpedia.org/resource/Arsenal_F.C.> } i.e.: show me the predicates ( ?relationship ) where the subject is the DBPedia resource Thierry_Henry and the object is

Converting UML to OWL Ontology

為{幸葍}努か 提交于 2019-12-13 03:05:28
问题 I am trying to develop an OWL ontology based on different UML file resources presented in xmi format. Reading through the internet for a while now, it seems that almost all the available tools or approaches are outdated and even when trying some of them they don't provide the expected outcome. Since this ontology plays a really important role in our project, i wanted to know what is the best approach/tools to be used in order to convert UML to OWL ? 回答1: I have looked into this myself as well

no inferences with DL queries in OWL - API

浪子不回头ぞ 提交于 2019-12-13 02:57:34
问题 I am trying to write a query Hospitals and hasNameWithWords value "center"^^string This query returns me the instances that has the hospitals that has "center" in its name in Protege 4.2 with FACT++ reasoner as well as Hermit reasoner but when i input the same query in the OWL-API's DL Query Example thats available in the website http://sourceforge.net/p/owlapi/code/ci/aef6981535f07a2d0d44c394b9f4d5415f36025a/tree/contract/src/test/java/org/coode/owlapi/examples/DLQueryExample.java I don't

why this variable is never have a value

僤鯓⒐⒋嵵緔 提交于 2019-12-13 02:57:29
问题 I am checking that if an instance has a value for a specific predicate, bound that value to a specific variable, otherwise, bound that variable to the value 1 of type integer. this is my code select ?boosted where { :r1 a ?x optional { ?item rs:boostedBy ?boostedOptional bind (if(bound(?boostedOptional), ?boostedOptional, "1"^^xsd:integer) as ?boosted) } } the value of ?boosted is always empty, look please why please? Note I think you don't need data to test why my code is not working,

SPARQL limiting the query result by a variable instead of the number of rows

白昼怎懂夜的黑 提交于 2019-12-13 02:12:48
问题 Lets say I have the following data set: :a rdf:type :AClass :a :hasName "a"^^xsd:string :a :hasProperty :xa :a :hasProperty :ya :a :hasProperty :za :b rdf:type :AClass :b :hasName "b"^^xsd:string :b :hasProperty :xb :b :hasProperty :yb :c rdf:type :AClass :c :hasName "c"^^xsd:string :c :hasProperty :xc I want to query the data set to give me back everything of an instance of :AClass , but only for two instances. I know I have to use the LIMIT keyword, and I have tried a lot of queries but

Why filter doesn't work in this context?

孤人 提交于 2019-12-12 20:57:19
问题 This is the query and the result: As you see, I am filtering out the users that are bo:ania , so why do they still appear? However, if I remove the widecard and select just the users ?user , bo:ania doesn't appear I didn't provide a minimum data example because this is a question about how filter and wildcard work, not about a problem in extracting some data from a data set. However, if you need a minimum data, I'm more than happy to provide it. 回答1: ?specificUser is bound to bo:ania by your

SPARQL - Find objects with the most similar properties

早过忘川 提交于 2019-12-12 18:17:01
问题 Lets say there is a RDF DB of people and each of these people has many triples defining this person's friends (so many of 'person' x:hasFriend 'otherPerson' ). How can I find people who have the most similar friends? I'm a novice at SPARQL and this seems like a really complex query. Basically, the results would be a list of people starting from the ones with the most similar friends list (to the person specified in the query) and then going down the list to the people with the least similar

Alternatives to SPARQL query with lots of UNIONs

让人想犯罪 __ 提交于 2019-12-12 14:23:12
问题 I have some named graphs stored in Virtuoso, and I want to find the one that matches the highest number of terms from a provided list. My query is constructed programatically and looks like this: SELECT DISTINCT ?graph (count(DISTINCT ?match) as ?matches) WHERE { GRAPH ?graph { {?match rdf:label "term 1"} UNION {?match rdf:label "term 2"} UNION {?match rdf:label "term 3"} ... } } ORDER BY DESC(?matches) Each term becomes another UNION clause. Is there a better way to do this? The query gets

Measuring distances among classes in RDF/OWL graphs

时光怂恿深爱的人放手 提交于 2019-12-12 08:48:46
问题 Maybe someone could give me a hint. Is it possible to measure the distance between 2 concepts/classes that belong to the same ontology? For example, let's suppose I have an ontology with the Astronomy class and the Telescope class. There is a link between both, but it is not a direct link. Astronomy has a parent class called Science, and Telescope has a parent class called Optical Instrument which belongs to its parent called Instrumentation, that is related to a class called Empirical

How to prevent triples from getting mixed up while uploading to Dydra programmatically?

筅森魡賤 提交于 2019-12-12 06:34:23
问题 I am trying to upload some data to Dydra from a Sesame triplestore I have on my computer. While the download from Sesame works fine, the triples get mixed up (the s-p-o relationships change as the object of one becomes object of another). Can someone please explain why this is happening and how it can be resolved? The code is below: #Querying the triplestore to retrieve all results sesameSparqlEndpoint = 'http://my.ip.ad.here:8080/openrdf-sesame/repositories/rep_name' sparql = SPARQLWrapper