Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: move additionalProperty up to Thing attribute #117

Open
noirbizarre opened this issue Aug 30, 2018 · 16 comments
Open

Proposal: move additionalProperty up to Thing attribute #117

noirbizarre opened this issue Aug 30, 2018 · 16 comments
Assignees

Comments

@noirbizarre
Copy link

Right now, the only mecanism allowing to extra custom properties is additionalProperty.

There is a lot of issues advising to use this attribute to declare extra custom properties but, sadly, it's only available on a very small subset of classes:

So the proposal is to make additionalProperty a Thing property because this property is non-specific, not domain related.

This will allow every child class to benefit from it (in my case I need it in particular on Dataset and DataDownload).

@thadguidry
Copy link

Describe what you need on Dataset
Describe what you need on DataDownload

Open separate issues for those 2 needs, so that the whole community can help you further.

@noirbizarre
Copy link
Author

I volontary proposed this change on Thing and not Dataset or DataDownload, because this is not the first time I tried to use it on something else.
In fact, I need it on Organization and Person too. I already needed it on other classes too.

Thing is the only common abstract ancestor which is already holding all generic properties. This is why it seems logical (to me) that additionalProperty is a Thing property.

(I also have some specifics on Dataset and DataDownload and will submit 2 other separates issues).

@mfhepp
Copy link

mfhepp commented Aug 30, 2018 via email

@Download
Copy link

Download commented Sep 3, 2018

What I was pretty amazed at when first learning about schema.org / JSON-LD is how restrictive the schema is towards custom / unknown properties. Why do we even need additionalProperty?

There is additionalType which makes some sense. You create additional schemas to support custom properties. Create a more specific type that has your custom properties, specify it in a schema and then use additionalType to add those properties to whichever object. However, the problem here is the overhead it gives. Creating a custom schema is a lot of work.

Why not just ignore unknown fields??

I understand it could give collisions later on when fields with the same name are added to the spec, but that could be easily solved with a naming convention (e.g. custom property names should start with an underscore).

Imho, the way it currently works, makes schema.org much less flexible a tool for many purposes. For example I investigated using schema.org entity types as the model for a web api, but the problem I run into is that adding custom properties is either ugly / impossible (as this issue demonstrates) via additionalProperty or just way to much work (via additionalType). I would like it MUCH more if the default behavior would just be to ignore unknown fields.

@danbri
Copy link
Contributor

danbri commented Sep 3, 2018

To be clear, additional property is a pretty weak approach in the sense that it handles very well the case where we don't really know what the properties are. This is common in ecommerce, where a site might have foo=bar, xyz=1000, or for geo/place, things like horse=true.

Aside from these you can always mix in other vocabularies, regardless of whether they are presented as "extensions" (like gs1.org/voc) to Schema.org or not. Whether search engine features make much use of these is beyond schema.org's remit, but the data structure is perfectly sensible and useful. So as @mfhepp says, we shouldn't encourage over-use of additionalProperty when normal properties from nearby vocabularies can be used instead.

@noirbizarre
Copy link
Author

I think using additionalProperty won't encourage schema-less attributes because if I use schema.org/JSON-LD this is because I want structured data.

I don't see additionalProperty as a replacement to strong typed properties but as complementary solution:

  • don't hide/loose data just because a property has not yet been standardized on schema.org
  • handle free key-values store on models
  • allows to detect properties to be typed and to become candidate to be officially part of a domain class.

I think would be easier to detect a recurrent additionalProperty and submit a model evolution proposal.

Plus, I've been looking into issues, and a recurrent response is: "You should use additionalProperty for this but this is not available on this class":

@danbri danbri self-assigned this Sep 4, 2018
@danbri
Copy link
Contributor

danbri commented Sep 4, 2018

Ping @rvguha - what do you think?

@danbri danbri changed the title Proposal: move additionnalProperty up to Thing attribute Proposal: move additionalProperty up to Thing attribute Sep 4, 2018
@VladimirAlexiev
Copy link

I second this proposal. Furthermore, https://schema.org/additionalProperty claims it applies to QualitativeValue and QuantitativeValue. But none of the examples shows such use.

  • Example 3 shows "Grouping and Hierarchical Order of Properties" but the link is value not additionalProperty https://github.com/schemaorg/schemaorg/issues/2145
  • So listing QualitativeValue and QuantitativeValue in domainIncludes is confusing and misleading. (At least I couldn't think of any actual example)

@vholland
Copy link

Are there remaining issues to discuss here?

@mfhepp
Copy link

mfhepp commented Nov 15, 2019

No, I think we can simply go forward.

As I was the original designer of this proposal, I would like to explain the motivation a bit:

There are many cases where publishers of data have identifiers for clearly defined properties. This can be either properties applied to all products in a shop, or properties from external standards like eCl@ss.

For those properties, we at least have a site-specific unique name or even a globally unique identifier from the external standard.

additionalProperty allows publishers to expose as much data semantics as they reasonably can without imposing a lot of additional barriers. This is better than a black or white approach where the property is either in schema.org or not supported.

The full rationale is described here: https://www.w3.org/wiki/WebSchemas/PropertyValuePairs

@rvguha
Copy link

rvguha commented Nov 15, 2019 via email

@danbri
Copy link
Contributor

danbri commented Nov 15, 2019

Agree with @rvguha here.

Schema.org is not a closed system, you can always add additional properties from other vocabularies when they're missing in schema.org.

It would be better to encourage that practice than to add an extra layer of indirection. The case of Product is reasonably special, aggregators do have useful property/value pairs that they barely understand. But we added a health warning into PropertyValue for good reason...

Always use specific schema.org properties when a) they exist and b) you can populate them. Using PropertyValue as a substitute will typically not trigger the same effect as using the original, specific property.

@vholland
Copy link

To advocate for this, there is some benefit to allowing developers to use https://schema.org/additionalProperty for experimenting before they get the schema correct.

As examples, there was some discussion in issue schemaorg/schemaorg#561 about the language at the other end of https://schema.org/EntryPoint. I would not say we have an answer yet, but using additionalProperty in WatchAction links has allowed some experimentation in the sorts of parameters a data reader might want. I still hope we can codify a good pattern for structuring this data.

Similarly, Google once used additionalProperty to understand JobPostings but once the space was clearer, worked with the community to adopt https://schema.org/jobLocationType.

I would not expect any reader to understand all uses of additionalProperty, but there are times like @mfhepp suggests where some data is better than none, particularly when exploring areas where authors have not previously provided structured data.

@rvguha
Copy link

rvguha commented Nov 17, 2019 via email

@danbri
Copy link
Contributor

danbri commented Nov 17, 2019 via email

@RichardWallis RichardWallis transferred this issue from schemaorg/schemaorg Jul 14, 2020
@RichardWallis
Copy link

See issue #7 for the context of the move from the main Schema.org issue tracker to this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants