2

If I use the default d2rq mapping file (ttl) all my colums are mapped to rdf properties. E.g. the colum ID becomes the Property "hasID" (after renaming).

  <rdf:Description rdf:about="http://www.semanticweb.org/adoxx/ontologies/2016/5/untitled-ontology-24#hasId">
    <rdfs:label>hasId</rdfs:label>
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
  </rdf:Description>

I want to replace the rdf property triple or add a further type triple so that my result is

      <rdf:Description rdf:about="http://www.semanticweb.org/adoxx/ontologies/2016/5/untitled-ontology-24#hasId">
        <rdfs:label>hasId</rdfs:label>
        <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
      </rdf:Description>

The documentation [1] states that types are generated automatically.

Do you have an idea how to get such a result? I need the distinction between DatatypeProperty and ObjectProperty so that they are correctly imported in the OWL-API [2].

[1]http://d2rq.org/d2rq-language [2]https://sourceforge.net/p/owlapi/mailman/message/35333117/

Ignazio
  • 10,504
  • 1
  • 14
  • 25
user3579222
  • 1,103
  • 11
  • 28
  • I have reviewed the code. I think that a replacement of the type property is not possible without changing the code (it is set in Mapping.java on line 261) – user3579222 Sep 05 '16 at 18:21
  • 1
    I've changed the tags because this is more Jena related than owlapi related. Owlapi requires the declarations because OWL does - so any OWL compliant library should behave the same. – Ignazio Sep 06 '16 at 14:32
  • There is now [ONT-D2RQ](https://github.com/avicomp/ont-d2rq) that takes care about semantic of schema automatically. This is OWL-API compatible solution. – ssz Nov 12 '18 at 19:52

1 Answers1

0

I found a solution for adding a second (OWL) type triple to the property (a solution for replacing the auto generated property seems not to be available without touching the code).

You have to update your ttl file by adding an additional Property triple (owldatatypeproperty was not created by d2rq, it was introduced by me!):

map:owldatatypeproperty a d2rq:AdditionalProperty;
    d2rq:propertyName rdf:type;
    d2rq:propertyValue <http://www.w3.org/2002/07/owl#DatatypeProperty>;
    .   

Then you have to extend the property bridge definition by referencing to the additonal property:

map:abc_ID a d2rq:PropertyBridge;
    .....
    d2rq:datatype xsd:integer;
    d2rq:additionalPropertyDefinitionProperty map:owldatatypeproperty;
    .

Thats it.

A short description is provided at [1]

[1] http://d2rq.org/d2rq-language#additionalproperty

user3579222
  • 1,103
  • 11
  • 28