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

test(api-v2): Test an ontology with only one entity #1433

Merged
merged 2 commits into from
Sep 10, 2019

Conversation

benjamingeer
Copy link

@benjamingeer benjamingeer commented Sep 10, 2019

  • Add minimal-onto.ttl and test how it's served in JSON-LD (always with @graph).
  • When updating test response files in OntologyV2R2RSpec, don't update RDF/XML files if only their blank node IDs have changed (makes it easier to check the really changed files into git).
  • Remove a generated client code file from git (this was causing confusing random errors in the client code test).

Resolves #1428.

@tobiasschweizer
Copy link
Contributor

Thanks! I will try that JSOn-LD in knora-api-lib-js.

@tobiasschweizer
Copy link
Contributor

I have added this in dasch-swiss/dsp-js-lib#28

Copy link
Contributor

@tobiasschweizer tobiasschweizer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So "@graph" is also an array if it contains just one element?

@benjamingeer
Copy link
Author

benjamingeer commented Sep 10, 2019

So "@graph" is also an array if it contains just one element?

Yes, Knora always inserts @graph in an ontology response, and the JSON-LD processor will keep the @graph if there is something else at the top level (you can see this behaviour in the JSON-LD Playground). The JSON-LD processor moves the contents of @graph to the top level only if the graph contains one node and the document contains nothing else.

@benjamingeer
Copy link
Author

Thanks!

@benjamingeer benjamingeer merged commit b60cc82 into develop Sep 10, 2019
@benjamingeer benjamingeer deleted the wip/1428-test-minimal-ontology branch September 10, 2019 12:26
@tobiasschweizer
Copy link
Contributor

Thank you, you are a true minimalist!

@benjamingeer
Copy link
Author

@benjamingeer benjamingeer mentioned this pull request Sep 10, 2019
@tobiasschweizer
Copy link
Contributor

I know Steve Reich :-)

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

Successfully merging this pull request may close these issues.

Test JSON-LD rendering of an ontology containing only one entity
2 participants