zazuko / xrm

A friendly language for mappings to RDF
MIT License
1 stars 0 forks source link

Keywords cannot be used within a vocabulary definition #53

Closed ktk closed 4 years ago

ktk commented 4 years ago

I've imported the whole schema.org namespace as vocabulary {} and I got some erros as I had a bunch of properties that are used as keywords so it stumbles over the use of them in a schema.

nnamtug commented 4 years ago

Escape such a word with ^. Example ^map instead of map.

mchlrch commented 4 years ago

Odd, declaring a ^map property works, but referencing it does not work

map EmployeeMapping from EMPLOYEE {
    subject template "http://airport.example.com/{0}" with id;

    properties
        employee:no from ^map
        employee:map from ^map
        employee:^map from ^map
}

logical-source EMPLOYEE {
    type xml
    source "EMP"

    referenceables
        id
        EMPNO
        ^map    
}

vocabulary employee {
    prefix "employee:" "http://example.com/employee"

    properties
        no
        ^map
}
nnamtug commented 4 years ago

this was a bug introduced by #12 (partially replace qname delimiter in grammar)