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

Support serializing individuals as string with context info #54

Closed
ledsoft opened this issue Mar 30, 2023 · 1 comment
Closed

Support serializing individuals as string with context info #54

ledsoft opened this issue Mar 30, 2023 · 1 comment

Comments

@ledsoft
Copy link
Contributor

ledsoft commented Mar 30, 2023

As a developer, I want to be able to make JSON-LD output as close to plain JSON as possible. This should include the ability to serialize individuals (plain identifier object property values as well as enum constants mapped to individuals) as string with info about the value being in identifier in the context.

For example, currently, an individual is serialized as an object with id:

{
  "@context": {
    "attribute": "http://example.org/attribute"
  },
  "attribute": {
    "@id": "http://www.w3.org/2002/07/owl#ObjectProperty"
  } 
}

Instead, it should be possible to configure the serialization (with context) so that the output is as follows:

{
  "@context": {
    "attribute": {
      "@id": "http://example.org/attribute",
      "@type": "@id"
    }
  },
  "attribute": "http://www.w3.org/2002/07/owl#ObjectProperty"
}

This should make it easier for clients to digest the JSON-LD. Note that this will not have any influence on deserialization and serialization without context.

@ledsoft
Copy link
Contributor Author

ledsoft commented Mar 30, 2023

Note that this is described as Expanded term definition in the JSON-LD specification.

ledsoft added a commit that referenced this issue Mar 31, 2023
ledsoft added a commit that referenced this issue Mar 31, 2023
ledsoft added a commit that referenced this issue Mar 31, 2023
…d for collection-valued object property attributes.
@ledsoft ledsoft closed this as completed Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant