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

feat: improve prefix handling in json ontos (DEV-572) #164

Merged
merged 4 commits into from Feb 28, 2022

Conversation

jnussbaum
Copy link
Collaborator

resolves DEV-572

@jnussbaum jnussbaum self-assigned this Feb 24, 2022
@jnussbaum
Copy link
Collaborator Author

jnussbaum commented Feb 24, 2022

Right now, the second step described in Jira works only because the rosetta prefix ist defined with "rosetta": "http://0.0.0.0:3333/ontology/082E/rosetta/v2". But it should also be possible to define it as "http://api.test.dasch.swiss/ontology/082E/rosetta/v2". This is not possible yet, and the API protests:

ERROR while trying to create property class hasLinkToOtherOnto. The error message was: KNORA-ERROR: status code=400
Message:{"knora-api:error":"org.knora.webapi.exceptions.BadRequestException: Invalid knora-api:objectType: http://api.test.dasch.swiss/ontology/082E/rosetta/v2#Image2D","@context":{"knora-api":"http://api.knora.org/ontology/knora-api/v2#"}}```

@sonarcloud
Copy link

sonarcloud bot commented Feb 24, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jnussbaum jnussbaum requested review from irinaschubert and removed request for BalduinLandolt February 24, 2022 17:50
@irinaschubert
Copy link

irinaschubert commented Feb 25, 2022

Right now, the second step described in Jira works only because the rosetta prefix ist defined with "rosetta": "http://0.0.0.0:3333/ontology/082E/rosetta/v2". But it should also be possible to define it as "http://api.test.dasch.swiss/ontology/082E/rosetta/v2". This is not possible yet, and the API protests:

ERROR while trying to create property class hasLinkToOtherOnto. The error message was: KNORA-ERROR: status code=400
Message:{"knora-api:error":"org.knora.webapi.exceptions.BadRequestException: Invalid knora-api:objectType: http://api.test.dasch.swiss/ontology/082E/rosetta/v2#Image2D","@context":{"knora-api":"http://api.knora.org/ontology/knora-api/v2#"}}```

Hi Johannes, the reason why the API protests when trying to reference http://api.test.dasch.swiss/ontology/082E/rosetta/v2 from within your local instance is that the local instance does not know api.test.dasch.swiss. For the API only one API exists (itself). This makes sense (at least to me), as we don't want to mix ontologies from different servers.

You could upload rosetta3.json to test.dasch.swiss like this:
dsp-tools create -s https://api.test.dasch.swiss -u user@email.ch -p secretpassword rosetta3.json

Does this answer your question?

@jnussbaum
Copy link
Collaborator Author

jnussbaum commented Feb 25, 2022

Thanks for the explanation, Irina. My intention was to make it working locally as well as on the test server. Is there no possibility for that?

Furthermore, I think we do want to allow ontologies from a different server, don't we? The other prefix "dcterms": "http://purl.org/dc/terms/" is also from a different server.

@irinaschubert
Copy link

irinaschubert commented Feb 25, 2022

Thanks for the explanation, Irina. My intention was to make it working locally as well as on the test server. Is there no possibility for that?

Furthermore, I think we do want to allow ontologies from a different server, don't we? The other prefix "dcterms": "http://purl.org/dc/terms/" is also from a different server.

I don't think that there is a possibility right now for that. And I can't think of any use case for that either. What would be your use case to reference properties of different dsp-api servers?

The difference with dcterms is: it is not used in object (as your example) but in super. This is a huge difference - for object the API has to be able to get information about that object (about the resource class Image2D, in your example) whereas it does not for super which just expresses a relationship.

Actually, there is an issue for the support of external vocabularies in the actual sprint: https://dasch.atlassian.net/browse/DEV-512. I'm not sure what it is exactly about but it is assigned to me and I will clarify this next week ;)

@jnussbaum jnussbaum merged commit 8610885 into main Feb 28, 2022
@jnussbaum jnussbaum deleted the wip/dev-572-improve-prefix-handling-in-json-ontos branch February 28, 2022 08:46
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

Successfully merging this pull request may close these issues.

None yet

2 participants