rdf

extract information from xml file as RDF triples

喜欢而已 提交于 2019-12-12 21:52:20
问题 Could any one please recommend a tutorial or tell me how can I build a java program for extracting information from xml files and produce the out put as RDF triples using an existing ontology. an example would be really helpful. Thanks 回答1: There are ready-made tools that address this problem, such as XSPARQL. You can write an XSPARQL query that queries the XML and produces RDF triples as output. This example should be pretty close to what you're looking for. 回答2: Your problem is really two

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

How to retrieve elements of OWL enumerated datatype expression?

被刻印的时光 ゝ 提交于 2019-12-12 18:04:58
问题 What SPARQL query should I use to show all values of union of two datatypes? Additionally how can I count the number of values in this union of datatypes? Each datatype was defined with DataOneOf(...) axiom. EDIT: to start with something: what SPARQL query should I use to show all values of the selected datatype? 回答1: In the future, it would be much easier if you can provide minimal data that we can work with. It would also make the question a bit clearer. As I understand it, you've defined

Counting number of individuals in SPARQL

我是研究僧i 提交于 2019-12-12 18:01:59
问题 I am totally new to SPARQL. I would like to count the number of actors in this ontology : http://data.linkedmdb.org/directory/actor I tried the following: SELECT ?s (COUNT(*) AS ?count) WHERE { ?a <http://data.linkedmdb.org/directory/actor> ?s} GROUP BY ?s But i believe that's not the right syntax for it because it gives me 0 results.. Where I know there are several results in that data source! Could it be that the link is not the correct one? 回答1: Counting actors per film In the original

Calculate the depth of subclass in the OWL ontology

删除回忆录丶 提交于 2019-12-12 14:44:10
问题 I'm looking for a SPARQL query that could return the position of specified subclass in the OWL hierarchy. I have studied several examples but the best result I could ever reach is the computation the relative paths between the specified superclass and its subclasses (thanks to Joshua Taylor). Instead of that I need to calculate the "absolute" depth for a given subclass. My ontology contains several top-level classes and every of them is followed with a separate tree of subclasses. Here is

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

How to compare simple and typed literals in dotnetrdf?

岁酱吖の 提交于 2019-12-12 11:25:01
问题 I'm comparing two graphs, one from a Turtle file with simple literal objects, the other from a file with explicit datatype IRIs. The graphs are otherwise equal. Graph A: <s> <p> "o" Graph B: <s> <p> "o"^^xsd:string According to RDF 1.1 (3.3 Literals), "[s]imple literals are syntactic sugar for abstract syntax literals with the datatype IRI http://www.w3.org/2001/XMLSchema#string". This is reflected in the concrete syntax specifications as well (N-Triples, Turtle, RDF XML). So I'd expect both

Using SPARQL to query DBPedia Company Information

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 10:06:25
问题 I'm trying to query DBPedia using SPARQL only to find company information such as a description, and a logo. I'm rather lost with devising the SPARQL Query to do this. SELECT DISTINCT ?subject ?employees ?homepage WHERE { ?subject rdf:type <http://dbpedia.org/class/yago/Company108058098> . ?subject dbpedia2:numEmployees ?employees FILTER ( xsd:integer(?employees) >= 50000 ) . ?subject foaf:homepage ?homepage . } ORDER BY DESC(xsd:integer(?employees)) LIMIT 20 I have come across the above

Error with SPARQL on Rstudio

我的未来我决定 提交于 2019-12-12 10:05:29
问题 I'm using the sparql package in Rstudio, to query OMIM through bio2rdf. I have tested my query in yasgui and it works correctly. But from Rstudio he returns the following error: > qde <- SPARQL(endpoint,query) Opening and ending tag mismatch: hr line 5 and body Opening and ending tag mismatch: body line 3 and html Premature end of data in tag html line 1 Error: 1: Opening and ending tag mismatch: hr line 5 and body 2: Opening and ending tag mismatch: body line 3 and html 3: Premature end of