lblod/ember-rdfa-editor

Improve handling around usage of prefixed vs full URIs

Opened this issue · 0 comments

A plugin/feature may fail due to the usage of prefixed vs non-prefixed predicates.

The problem
rdfaAware plugins/features may currently fail due to the usage of prefixed vs non-prefixed predicates/uris.
When adding a property/backlink to a node, we currently allow the usage of prefixed URIs.
The problem is that these URIs do not (always) get directly expanded:

  • This may be due to the fact that the prefix they use is not defined
  • Sometimes, the prefix only gets expanded after a reload of the document

This can be a pain, as we need to take the prefixed, as well as the full version of URIs when writing plugins/features.

Solutions

  • Short-term: when inserting a predicate/property, we should always use the 'long' version of the URI, and not the prefixed one
  • Long-term: only allow inserting prefixed predicates/uris when those prefixes have been defined in the document. Automatically expand URIs when reading/inserting them.