Using prefixe foaf when creating Ontop mappings.

316 views
Skip to first unread message

Vidar Norstein Klungre

unread,
Sep 25, 2014, 6:05:16 AM9/25/14
to ontop...@googlegroups.com
Hello.

I have a setup where I have imported the foaf ontology in Protege, and I want to use concepts from foaf when creating mappings between my MySQL database and the foaf:Person concept. I'm pretty sure foaf is imported correctly, and I have defined the foaf prefix, but I'm not able to use it when creating mappings manually.

The mapping I try to make looks like this, but it is not accepted by Ontop.
<Person-{p_id}> a foaf:Person .
In particular, it does not recognize foaf:Person.

I have also tried the following mapping templates with no luck:
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<Person-{p_id}> a foaf:Person .
and 
<Person-{p_id}> a <http://xmlns.com/foaf/0.1/Person> .

However Ontop accepted my custom made class called Myperson, so the problem is indeed with the foaf Person class:
<Person-{p_id}> a :Myperson .

So is it something wrong with the mapping templates I have tried, or have I not been able to import the foaf ontology correctly? For more details, I have added screenshots, and more details below.

Best regards, Vidar Klungre




Detailed workflow:

0. Set up a MySQL database.

1. After importing the ontology into Protege (using Ontology imports), I got an error: "URI Scheme not file". This is obviously not good, but after pressing ok, everything looked fine. I also added an ontology prefix in the Active ontology tab. 
Prefix: foaf

2. Checking the Class tab, and yes, all the foaf concepts are there, including the Person concept I want to use.

3. Go to the ontop mappings tab, and set up a data source.

4. ontop mappings tab -> mapping manager -> create new mapping. Setting SQL query to "select * from ex1", which returns my data. Good. I try to the following mapping templates:
<Person-{p_id}> a foaf:Person .
Result: Not accepted
Error message: "ERROR: The below list of predicates is unknown to the ontoogy: - nullPerson"
Comment: I expected this to work, given the fact that I have defined the foaf prefix in Protege.

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<Person-{p_id}> a foaf:Person .

Result: Not accepted
Error message: "ERROR: The below list of predicates is unknown to the ontoogy: - http://xmlns.com/foaf/0.1/Person"
Comment: Testing if I added the prefix also inside the mapping template.

<Person-{p_id}> a <http://xmlns.com/foaf/0.1/Person> .
Result: Not accepted
Error message: "ERROR: The below list of predicates is unknown to the ontoogy: - http://xmlns.com/foaf/0.1/Person"
Comment: Testing if it worked when writing the full path.

<Person-{p_id}> a :Myperson .
Result: Accepted.
Comment: This was to confirm that the object is the problem.





Protege.zip

Benjamin Cogrel

unread,
Sep 26, 2014, 11:31:54 AM9/26/14
to ontop...@googlegroups.com, Vidar Norstein Klungre
Hello Vidar,

xmlns.com is currently down so I cannot import the ontology from Protege.

However, I added manually the foaf:Person class (by giving its URL), added the prefix foaf as you did in the "Ontology prefixes" tab and I was able to write mappings like you did:


<Person-{p_id}> a foaf:Person .

While this mapping is not rejected, I suggest you to use a CURIE instead of a relative IRI:
:Person-{p_id} a foaf:Person .

Best regards,
Benjamin
--
You received this message because you are subscribed to the Google Groups "ontop4obda" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontop4obda+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages