question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use Namespaces to add terms from other Metadata Schemes

See original GitHub issue

See also:

  • #144 Namespace Discussion
  • #103 Encapsulated Extensibility
  • #87 Profiles

There is a wide variety of metadata schemes. They share a common core of terms, but also have many disjoint terms. To facilitate interoperability, it would be valuable to have a way to link the common terms across these schemes, and when foreign properties are added to data package metadata, to identify the source scheme.

A simple way to do this would be to create a translation table for common terms, and add a namespace feature to prefix foreign terms.

For reference to the terms in other schemes, here is a spreadsheet that links terms between Data Package, Metatab, POD, Dublin Core, CKAN, DCAT and Schema.Org.

A possible implementation of this feature would be to add a ‘namespace’ property:

{
   "namespaces":  {
    "pod" : "http://example.com/pod/namespace/url",
    "mt": "http://metatab.org"
  }
}

Then, foreign terms could be prefixed:

{
  "name": "my-unique-datapackage",
  "title": "My Unique Data Package",
  "pod:conformsTo": conformity-spec,
  "mt:keywords": { 'kw1', 'kw2' }
}

Processing With Namespaces

Tools that process datapackage metadata can use the name spaces to produce fully-qualified JSON, in which every property name is prefixed. Property names that are originally un-prefixed and are specified by a Data Package spec would be given a default datapackage prefix, for instance “dp:”. Terms that are linked could be re-mapped into the Data Package namespace. For instance the property name “mt:Title” could be remapped to “dp:Title”.

The namespaces feature should be optional. Tools that don’t recognize namespaces can use the defined data package properties without prefixes.

Impact

If the defined Data Package terms are never prefixed, then this feature could be implemented as a customization, and does not need to be incorporated into the spec. That is, the “namespaces” property can be added by end users as a custom property, and foreign terms can be prefixed, without changes to the core spec. So, this feature could be implemented by end users as a common practice, rather than a change to the spec.

Separability

Even if Data package do not incorporate namespaces, maintaining a term map like the one referenced above may be valuable to allow data package metadata to be transformed into other schemes.

Criticisms

Here is a discussion about why adding names spaces to JSON is a bad idea, or at least an accounting of all of the ways to do it wrong.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eocarragaincommented, Nov 15, 2017

@rufuspollock @ericbusboom I know this has been discussed in before (see #110; #218), but isn’t json-ld a simple, widely adopted, unobtrusive, developer-friendly way of tackling his problem? Apologies if I’m missing something obvious!

0reactions
rufuspollockcommented, Apr 30, 2020

DUPLICATE. I’m closing this in favour of the newer issue that covers the same core ground #663.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XML Schema: Understanding Namespaces - Oracle
Moving to XML Schema? This introduction to namespaces will help you understand one of its more important elements.
Read more >
How to add custom namespace metadata in Office files
What you get to do is store XML documents in Custom XML Parts, and manipulate them via the relevant object models, e.g. via...
Read more >
Namespaces in XML 1.0 (Third Edition) - W3C
XML namespaces provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating ...
Read more >
DCMI Metadata Terms - Dublin Core
This document is an up-to-date specification of all metadata terms maintained by the Dublin Core Metadata Initiative, including properties, ...
Read more >
Use namespace tags to include other conventions in netcdf ...
I like the idea of namespaces, thanks for bring this out. Defining them in the Conventions attribute is ok, although a separate global...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found