I need to link automatically the information from DBpedia to my own ontology.
Real scenario:
I created an individual (I can create a class also if necessary) of the country 'Austria'. I named it dbpedia:Austria (Protege recognize it as 'https://dbpedia.org/page/Austria').
Once created, I want to add in the Annotation tab the rdfs:label and dbo:abstract and I need the information to be filled automatically from 'https://dbpedia.org/page/Austria' (i.e. rdfs:label = Austria #en and dbo:abstract = Austria ( (), ; German: Österreich [ˈøːstɐʁaɪ̯ç] ()), officially the Republic of Austria (German: Republik Österreich, ), is a landlocked East Alpine country in the southern part of Central Europe. It is composed of nine federated states.......
Questions:
Is this possible? Do I have to create 'Austria' as an individual? or a class? the rdfs:label and dbo:abstract has to be in the Annotations Tab? Or object properties? or data properties?
Solution found:
It seems that TopBraid Composer (from TopQuadrant) has a feature which allows to link DBpedia information to the ontology automatically. Here is the link: https://www.youtube.com/watch?v=O-KFEMzx0MY
However, I would like to use Protege if this is possible. TopBraid is not free.
Thanks,
Marius
Related
I notice that some books on Wikidata have Project Gutenberg ebook IDs. Is it possible to construct a query on the Wikidata Query Service that looks for all books that have this property? I'm new to SPARQL.
As you can see if you hover over the link for the Project Gutenberg e-book Id on https://www.wikidata.org/wiki/Q6511, the actual property code to be used in SPARQL is https://www.wikidata.org/wiki/Property:P2034, or wdt:P2034 for short.
To retrieve all items with e-book IDs through SPARQL is then simply a matter of doing a basic triple match:
SELECT ?work ?bookId
WHERE { ?work wdt:P2034 ?bookId }
Of course you can extend this query how you see fit. For example to retrieve the (English) title of the book instead of just the identifier, you can do something like this:
SELECT ?title ?ebook_id
WHERE {
?work rdfs:label ?title;
wdt:P2034 ?ebook_id.
FILTER(langMatches(lang(?title), "en"))
}
It's all a matter of adding the right combination of triple patterns and filters.
I have inspired this articles and created an ontology with using geosparql ontology. Two classes named Area and Park were created as subclasses of the Feature class of geosparql. 3 Area instances and 1 Park instance were added to the ontology. Then, geometry instances were created (asWKT) as a subclass of Polygon class of geosparql. And the geometry instances were related with the Park and Area instances via hasGeometry object property (The created ontology and instances).
I have tried to make a topology query to find out which Area instances are within the Park instance. So, I have run the below query with using the sparql query plugin of Protégé 4.3.
PREFIX geosparql: http://www.opengis.net/ont/geosparql#
PREFIX su: http://www.example.org/su#
SELECT ?x ?y
WHERE {
?x a su:Area ;
geosparql:hasGeometry ?xgeo .
?y a su:Park ;
geosparql:hasGeometry ?ygeo .
?xgeo geosparql:sfWithin ?ygeo .
}
No results return but I know that there are two Area instances within the Park instance. I did not find out the problem. Do not I query topological relations with using geosparql and protégé?
The problem is you don't import the "good" use of sfWithin entity.
There is a difference between
http://www.opengis.net/ont/geosparql#sfWithin and http://www.opengis.net/def/function/geosparql/sfWithin.
Actually, I don't understand yet how to proceed in Protégé with this statement, I'm sorry about that.
If you really need to use such a topology query, you can use GraphDB instead, which implements a good working plugin for GeoSPARQL.
I trying to figure out the correct usage of "participant of" (P1344) and participant (P710).
As sample I want the participants of the US Civil War.
The first statement:
SELECT ?label WHERE {
wd:Q8676 wdt:P710 ?subj.
?subj rdfs:label ?label.
FILTER((LANG(?label)) = "en")
}
returns the Union & CSA.
So I tried the "reverse" Statement with participant of:
SELECT ?label WHERE {
?subj wdt:P1344 wd:Q8676.
?subj rdfs:label ?label.
FILTER((LANG(?label)) = "en")
}
Which gives me a list of 9 names and the CSA, but not the Union.
Thus, I am a bit confused, why 1) there are several people listed, especially since I don't know any of them. (My guess those are unaffiliated ones), 2) the Union is missing, 3) how does the correct statement for participant of looks like.
Inverse properties aren't kept in sync, so you can find a lot of statements going in one direction without the inverse statement. Keeping inverse statements in sync was discussed here and there, but never done, and maybe for the better as it would be a big mess: in your example, if every participant of the American Civil War or of WWII were to be added to those pages, we would potentially get very very VERY overloaded pages: using the property conflict (P607), I found
2536 known participants to the American Civil War
31698 known participants to WWII
(btw, see how you can use SERVICE wikibase:label to find labels instead of using filters)
So there seem to be a convention to link from the "small entity" to the "big entity", and keep properties such as participant (P710) for especially notable entities relatively to the subject. So the Union & CSA, rather than every single known general and soliders.
Viewing the go-plus ontology in a freshly installed, stock Protégé 5, I found a useful inference in the entities tab for http://purl.obolibrary.org/obo/GO_0003215:
'cardiac right ventricle morphogenesis' 'results in morphogenesis of' some 'cardiac ventricle'
'results in morphogenesis of' in this case is http://purl.obolibrary.org/obo/RO_0002298 and 'cardiac ventricle' is http://purl.obolibrary.org/obo/UBERON_0002082
If I load the same ontology into Virtuoso Open Source 07.20.3217 and describe http://purl.obolibrary.org/obo/GO_0003215, no relationship with 'cardiac ventricle' is listed. (Even after enabling OWL inference.)
However, http://purl.obolibrary.org/obo/GO_0003215 is linked to an anonymous node with
rdf:type owl:Restriction
owl:onProperty n3:RO_0002298
owl:someValuesFrom n3:UBERON_0002080
Where n3 is http://purl.obolibrary.org/obo/
Is there a Virtuoso configuration that would make this relationship clear in a describe view?
Is there some concise SPARQL syntax that would make the relationship clear? Currently, I'm using
select distinct ?goid (str(?goterm) as ?go_str)
?svf (str(?anatomy ) as ?anat_str)
where
{
?goid obo:hasOBONamespace 'biological_process'^^xsd:string .
?goid rdfs:label ?goterm .
?goid rdfs:subClassOf+ ?parent .
?parent owl:someValuesFrom* ?svf .
?svf rdfs:subClassOf+
<http://purl.obolibrary.org/obo/UBERON_0001062> .
?svf rdfs:label ?anatomy
}
There are many things in play here.
You can use Property Paths for transitivity, as described in comment by #ASKW.
If you want to leverage Virtuoso's built-in reasoning for relationship types described by RDF Schema (rdfs:subClassOf, rdfs:subPropertyOf, rdfs:subClassOf) or OWL (owl:equivalentProperty, owl:equivalentClass, owl:SymmetricProperty, owl:inverseOf, etc.), then you can leverage the inference rules pragma as described in #MarkMiller's comments (note reference to a blog post about that usage pattern).
If you want to write custom inference rules (i.e., use SPARQL as your Inference Rules language), then you will need Virtuoso 8.0 (coming soon) which delivers that capability. Note, this is the ultimate solution, as you can write your own algorithms using SPARQL.
How do you enable OWL reasoning in Virtuoso? You should know that it doesn't support OWL DL reasoning, but only some kind of rule-based reasoning which only covers a small part of OWL DL. Protege on the other hand supports OWL DL reasoning by means of reasoners like HermiT, Pellet, etc.
If you mean by "enable OWL inference" just using SPARQL 1.1 proeprty paths on the rdfs:subClassOf relation, then this is far away from OWL DL reasoning. It just means to consider the transitive closure of that relation from a start node in the graph, nothing more and no more magic behind.
I have the following query:
SELECT DISTINCT(?person1), ?person2
WHERE {
?person1 ?p ?person2.
?person1 a foaf:Person.
?person2 a foaf:Person.
}
ORDER BY ?person1
LIMIT 1000
OFFSET 0
If you scroll down the results of the query here: http://dbpedia.org/snorql/
You'll see ice hockey teams etc. listed e.g.
:%C3%81g%C3%BAst_Hauksson :Iceland_national_under-21_football_team
why are these people? How can I remove them?
I also get results like:
:%C3%84ngelholms_FF__Jakob_Augustsson__1 :Jakob_Augustsson
:%C3%84ngelholms_FF__Joakim_Alriksson__1 :Joakim_Alriksson
:%C3%84ngelholms_FF__Johan_Eiswohld__1 :Johan_Eiswohld
Which just reference the same person - is there a way to remove these sorts of self-references in the original query?
The resource http://dbpedia.org/resource/Iceland_national_under-21_football_team is typed a foaf:Person (and dbpedia-owl:Person etc.), which is why it shows up in the result set.
Looking at the statements, I see that this resource is also a dbpedia-owl:SportsTeamMember, which is a subclass of dbpedia-owl:Person, which is an owl:equivalentClass of foaf:Person. This shows how the sports team was inferred to be a person.
The information in DBpedia is extracted from Wikipedia using templates, as described here. In general, mapping templates map the information in Wikipedia infoboxes and other templates to DBpedia resource properties. An article having a certain infobox (or for other mappings, a 'normal' template) are then said to be of a specific RDF class.
For example, the Infobox football club mapping template maps creates resources of type dbpedia-owl:SoccerClub from articles that have this infobox. (This doesn't apply to the Iceland team, though.)
It looks like the mapping Football squad player may have been responsible for the assertion that the Iceland team is typed a person. The template is used to list the team players, but the version of the Wikipedia page used to create the DBpedia resource has typos that could have broken the process. I'm not completely sure, but it may explain why not all national football teams are typed foaf:Person.
You can't remove specific statements from DBpedia, but you can correct errors in the source Wikipedia article, or correct, update or create mappings for DBpedia.
To remove self references, you can add a FILTER statement to your WHERE clause like this:
WHERE {
?person1 ?p ?person2.
?person1 a foaf:Person.
?person2 a foaf:Person.
FILTER (?person1 != ?person2).
}
If you are looking for specific types of relations between pairs of foaf:Persons, you can of course specify them:
WHERE {
...
?person1 foaf:knows ?person2.
...
}
Edit 2: I later realised you were asking for a different type of self-reference. From DBPedia: What's the meaning of '__1' (double underscores) in URIs? I understand these are URIs for intermediate nodes, created to avoid having to use blank nodes. For example, :%C3%84ngelholms_FF__Jakob_Augustsson__1 is the (prefixed) URI for Jakob Augustsson within (the description of) :%C3%84ngelholms_FF. For the football example, you could add FILTER (?p != dbpedia-owl:currentMember) to exclude these results.
Edit 1: added a few hyperlinks.