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

Generate ARK URLs for resources #1161

Merged
merged 38 commits into from
Jan 21, 2019
Merged

Generate ARK URLs for resources #1161

merged 38 commits into from
Jan 21, 2019

Conversation

benjamingeer
Copy link

@benjamingeer benjamingeer commented Jan 14, 2019

  • In API v2, return an ARK URL as part of the metadata of each resource (in ReadResourceV2.toJsonLD).
  • Add documentation:
    • docs/src/paradox/03-apis/api-v2/resource-permalinks.md
    • docs/src/paradox/05-internals/design/api-v2/ark.md
  • Change all resources in test data to use Knora's standard resource IRI format, so we can generate ARK URLs for them.

Resolves #844.

@benjamingeer benjamingeer mentioned this pull request Jan 14, 2019
Benjamin Geer added 16 commits January 14, 2019 17:07
- Don't use a delimiter before the check digit.
- Use a slash as the delimiter before the timestamp.
- Make version, project ID, and resource ID an object hierarchy.
- Make the timestamp an object variant.
- Escape - as =.
- Don't use hyphens or colons in timestamps in ARK URLs.
…ing).

- Use 0-based character values in check digits, otherwise the maths don't work.
- Add missing project IDs to IRIs in test data.
- Replace remaining occurrences of data.knora.org with rdfh.ch.
@benjamingeer benjamingeer changed the title Generate and validate ARK URLs for resource IRIs Generate and resolve ARK URLs for resources Jan 16, 2019
@benjamingeer benjamingeer mentioned this pull request Jan 17, 2019
@tobiasschweizer
Copy link
Contributor

tobiasschweizer commented Jan 18, 2019

@benjamingeer I have data that still has http://data.knora.org instead of http://rdfh.ch

This is because we have a productive Knora as of summer 2016. The IRIs are referred from XML transcriptions.

@benjamingeer
Copy link
Author

@tobiasschweizer We can fix all your IRIs together next week, it's not difficult, I've just done this for the Incunabula test data.

@tobiasschweizer
Copy link
Contributor

@benjamingeer I also think that it won't be hard. I actually used emacs regex search and replace to adapt the permissions.

I just have to do the same thing in the XMLs where the IRIs are used.

@subotic Maybe the internal beol server should be re-installed from scratch. This time, I would like to use docker. Could you give me a hand?

- Update docs and release notes.
@subotic
Copy link
Collaborator

subotic commented Jan 18, 2019

@subotic Maybe the internal beol server should be re-installed from scratch. This time, I would like to use docker. Could you give me a hand?

Sure, we can take the deployment configuration from production and change it for the internal beol server.

Benjamin Geer added 5 commits January 18, 2019 15:27
# Conflicts:
#	webapi/src/test/scala/org/knora/webapi/responders/admin/PermissionsResponderADMSpec.scala
# Conflicts:
#	docs/src/paradox/00-release-notes/next.md
#	salsah1/src/typescript_interfaces/sampleRequests/sampleResourceResponses.ts
#	webapi/src/test/scala/org/knora/webapi/responders/v1/ResourcesResponderV1Spec.scala
#	webapi/src/test/scala/org/knora/webapi/responders/v1/SearchResponderV1Spec.scala
@benjamingeer benjamingeer requested a review from subotic January 20, 2019 08:56
Copy link
Collaborator

@subotic subotic left a comment

Choose a reason for hiding this comment

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

Can we please move ark.py to its own repository?

@benjamingeer
Copy link
Author

Can we please move ark.py to its own repository?

Yes, good idea.

@subotic
Copy link
Collaborator

subotic commented Jan 21, 2019

I've taken the liberty and moved it into its own repository :-)

https://github.com/dhlab-basel/ark-resolver/

@benjamingeer benjamingeer changed the title Generate and resolve ARK URLs for resources Generate ARK URLs for resources Jan 21, 2019
@benjamingeer
Copy link
Author

Great, thank you!

@subotic
Copy link
Collaborator

subotic commented Jan 21, 2019

Thanks :-)

@subotic
Copy link
Collaborator

subotic commented Jan 21, 2019

@benjamingeer Any particular reason why the resolver is written in python and not in scala? You know that you are now the sole responsible person for maintaining the code ;-)

- Refactor ARK design and API docs.
- Fix broken test.
@benjamingeer
Copy link
Author

Any particular reason why the resolver is written in python and not in scala?

Two reasons:

  1. It's such a simple program, I think it doesn't need a JVM consuming gigabytes of memory.
  2. I think some people might want to write their own ARK resolvers for use with Knora, they'll want to look at this one to see how it works, and it might be easier for them to read code in Python than in Scala.

you are now the sole responsible person for maintaining the code ;-)

That's OK, I can live with maintaining this, because it hardly does anything. :)

@benjamingeer benjamingeer merged commit 2b92c7d into develop Jan 21, 2019
@benjamingeer benjamingeer deleted the wip/844-ark-urls branch January 21, 2019 15:24
@ezbinden
Copy link

Hi Ben, Ivan
Could this be a breaking change for some of our partners? If yes they should be notified via the DaSCH team list
Cheers, E.

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.

5 participants