As posted in #721082: Prevent conflicting namespaces and move hook_rdf_namespaces() invocation into rdf.module, namespace collision is handled as long as neither namespace is redefined. However, once one of the colliding implementations of hook_rdf_namespaces is fixed, the site will be minting erroneous terms.
For instance:
- User installs module X (which has redefined foaf)
- Drupal saves x_rdf_mapping to the database, including foaf:CrazyNewClass
- Someone (either user or module creator) fixes hook_rdf_namespaces and foaf is no longer defined twice
- Because foaf:CrazyNewClass is defined in the mapping for the bundle, we have triples that assert typeof http://xmlns.com/foaf/0.1/CrazyNewClass.
Currently, all is fine because foaf is defined twice and the prefix has been dropped.
All of the sudden, we have inaccurate statements.
We can fix this by running all of the curies through a function at the time of module installation to ensure that their prefix has only been defined once. If it has been defined more than once, or not defined at all, don't save the term in the mapping.
| Comment | File | Size | Author |
|---|---|---|---|
| rdf_ns-conflict.patch | 5.99 KB | linclark |
Comments
Comment #1
scor commentedtagging
Comment #2
scor commentedtool late for Drupal 7
Comment #3
Anonymous (not verified) commentedNew issue to track this at #1778410: Throw exception when RDF namespaces collide