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

JSON-LD Context Generator: Generate "@type": "@id" when appropriate. #65

Closed
timothee-haudebourg opened this issue Nov 4, 2022 · 0 comments · Fixed by #66
Closed

JSON-LD Context Generator: Generate "@type": "@id" when appropriate. #65

timothee-haudebourg opened this issue Nov 4, 2022 · 0 comments · Fixed by #66
Assignees
Labels
enhancement New feature or request scope:gen:json-ld-context Related to the JSON-LD context generator

Comments

@timothee-haudebourg
Copy link
Collaborator

In a JSON-LD context term definition, the binding "@type": "@id" is used to specify that any string literal as value of this term should be interpreted as a node identifier. For TreeLDR, this is when the layout of a field can be a reference.

For instance:

type Foo {
	bar: &rdfs:Resource
}

This should generate the following LD context:

{
	"bar": {
		"@id": "https://example.org/bar",
		"@type": "@id"
	}
}

This should also work with a union layout where one of the term is a reference:

type Foo {
	bar: &rdfs:Resource | rdfs:Resource
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scope:gen:json-ld-context Related to the JSON-LD context generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant