RMLio / RML-Mapper

Generate High Quality Linked Data from multiple originally (semi-)structured data (legacy)
http://RML.io
52 stars 20 forks source link

Using prefixes to define rr:template? #36

Closed canarvaeza closed 6 years ago

canarvaeza commented 6 years ago

Hi,

In my ontology I have a parent class called Role and some subclasses as FamiliarRole and SocialRole, on my JSON the role values will be represented as:

"Role": {
         "Type": "FamiliarRole",
         "Value": "Son"
 },

This because for me is important to know the role, but I have already created some individuals as Son and Friend, so I'm making something like

<http://mcas.com/Person/n001> a <http://xmlns.com/foaf/0.1/Person>  ;
<http://www.semanticweb.org/ontologies/mcontext#hasRol> <http://www.semanticweb.org/ontologies/domains/alzheimer#Son> .

with

rr:subjectMap [
        rr:template "http://www.semanticweb.org/ontologies/domains/alzheimer#{Value}";
    ].

As you can see thats predefined (and I think my direction will change a lot of times in development) it is any way of using the alzheimer prefix I have defined at the begining of the rml file? @prefix alzheimer: http://www.semanticweb.org/ontologies/domains/alzheimer#.

I try this but that gives me an error.

rr:subjectMap [
        rr:template alzheimer:"{Value}";
    ].

Thanks

canarvaeza commented 6 years ago

As I can't put the prefix on the template i handle it this way:

In JSON i had to put the class's URI:

"Multimedia": [
    {
      "Id": "multimedia/0001",
      "Format": "AVI",
      "Type": "www.semanticweb.org/ontologies/multimedia#VideoFormat"
    }
]

in Model.rml is necesary to write a http:// or the thing doesn't work

    rr:predicateObjectMap [
        rr:predicate rdf:type;
        rr:objectMap
        [
            rr:template "http://{Type}";
        ]
    ];

This give me an error related with the url coding, so the result I get is

<rdf:Description rdf:about="http://mcas.com/Multimedia/multimedia**%2F**0001">

What seems to cause problems in the next steps of my system (in my own app).

I'm trying to solve this.