zazuko / xrm

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

Vocabulary elements used as constant value don't contribute their PREFIX #151

Closed mchlrch closed 6 months ago

mchlrch commented 6 months ago

Since XRM version 1.2.0 it is possible to use vocabulary elements (class, property, datatype) as a constant value.

Used in this way, the vocabulary elements don't contribute their PREFIX and the generated mapping files can end up being incomplete, with undefined prefixes.

@mchlrch a little bit later ... I am on XRM version 1.3, and your example above should work. It doesn't, because using that class declaration does not update declarations in the mapping file:

I do (in mapping.xrm):

map level_archive from stabs_ogd.rr_archive {
  subject template rrURI with ID_NR;

  types
    rico.RecordSet

  properties
    rico.history from ARCHIVGESCHICHTE with language-tag ger; // @todo: use rico.Event class later
    rico.hasRecordSetType constant stabslevels.Archiv;
}

stabslevels.Archiv is declared as a class in vocabs.xrm. In the newly generated mapping.carml.ttl, the prefix stabs-rstis not declared. Carml throws the error:

error: Undefined prefix "stabs-rst:" on line 131

If I use it in types, and not as a constant, the declaration is done.

@oschihin That sounds like a bug. Thanks for reporting it

Originally posted by @mchlrch in https://github.com/zazuko/xrm/issues/142#issuecomment-1840967179

mchlrch commented 6 months ago

Resolved in xrm version 1.5.0