rdfjs / data-model-spec

RDF/JS: Data model specification – A specification of a low level interface definition representing RDF data independent of a serialized format in a JavaScript environment.
http://rdf.js.org/data-model-spec/
73 stars 12 forks source link

feature detection #141

Open bergos opened 5 years ago

bergos commented 5 years ago

As proposed in #136 new features should get it's own spec. Maybe it would be good if we define a standard way for feature detection in this spec, as it will be the core spec other spec will refer to.

In #123 @jacoscaz proposed this:

Not everything can be standardized. Any feature that is relevant to only a few use cases, such as the advanced filtering mentioned above, might not be everyone's cup of tea. However, it would be nice to have a standardized way to advertise such features, so that other components using RDF/JS interfaces would be able to make use of these non-standard features when possible while normally defaulting to standard expectations. Something like the following could work:

source.supportedFeatures = ['source-filters']

jacoscaz commented 4 years ago

Based on some thinking in https://github.com/rdfjs/data-model-spec/issues/166 and others, I guess we could have a supportedInterfaces property pointing to which interfaces are supported by a given object? This would require interfaces to be free of optional methods IMHO. Which I would be fine with, I think.