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

Colons in predicates are problematic #1806

Closed
dannylamb opened this issue Apr 28, 2021 · 9 comments
Closed

Colons in predicates are problematic #1806

dannylamb opened this issue Apr 28, 2021 · 9 comments
Assignees

Comments

@dannylamb
Copy link
Contributor

Discovered during today's open meeting. We tried to set field_description to https://www.wikidata.org/wiki/Property:P7535 and in the jsonld we got wikidate:Property instead of wikidate:Property:P7535.

As a temporary fix, I could url encode the colon and we got wikidata:Property%3AP7535, but that feels crude. There's a couple places in the jsonld module where we explode predicates on colon, so it's likely we're just assuming you can't have colons in predicates somewhere in there.

@kspurgin
Copy link
Contributor

@ajstanley
Copy link
Contributor

PR is in

@seth-shaw-unlv
Copy link
Contributor

seth-shaw-unlv commented May 3, 2021

Resolved by Islandora/jsonld@dfd99c4

Side note: while reading the Wikidata documentation on namespaces it occured to me that Wikidata wants separate namespaces for each type. After all, they provide their own table of namespaces.

So, to use Wikidata with Islandora, ideally you would add the following (admittedly incomplete, because I wasn't sure which ones would actually be used) to your json-ld config:

EntitySchema|http://www.wikidata.org/wiki/EntitySchema:
Media|http://www.wikidata.org/wiki/Media:
Property|http://www.wikidata.org/wiki/Property:
P|http://www.wikidata.org/wiki/Property:
Q|http://www.wikidata.org/wiki/
Special|http://www.wikidata.org/wiki/Special:

Although, "Q" is a cheat, because wikidata uses an empty prefix for that namespace, which we don't support. Also note, that you can use multiple prefixes for the same namespace, such as "Property" and "P".

Either way, @ajstanley' PR works for both.

@kspurgin
Copy link
Contributor

kspurgin commented May 3, 2021

I think realistically the only Wikidata namespaces I can imagine being used in metadata in Islandora are P/Property and Q.

@kspurgin
Copy link
Contributor

kspurgin commented May 3, 2021

FWIW, and fun, I just ran across another linked data source (PeriodO) with URIs like: http://n2t.net/ark:/99152/p0323gxv8wc

Where http://n2t.net is a public resolution service for identifiers, and http://n2t.net/ark:/99152 is the Name Assigning Authority, http://n2t.net/ark:/99152/p0 is the PeriodO data set prefix, http://n2t.net/ark:/99152/p0323gx is the source from which a subset of period terms were identified, and http://n2t.net/ark:/99152/p0323gxv8wc is the URI for an individual period term.

So terms/concepts from PeriodO have URI beginning with http://n2t.net/ark:/99152/p0

http://n2t.net/ark:/99152/p0323gxv8wc

And terms/concepts from YAMZ have URI beginning with http://n2t.net/ark:/99152/h

http://n2t.net/ark:/99152/h3791

Are there any assumptions we've made that this breaks?

At any rate, further confirmation it was good to fix this. Thanks!

@kspurgin
Copy link
Contributor

kspurgin commented May 3, 2021

Oh, ha! Islandora is a development partner of N2T.net so we should probably make sure we support their patterns of things.

@ajstanley
Copy link
Contributor

We should be good - adding the limit of 2 means you get two chunks - $exploded[0] which has everything before the first colon, and $explode[1] which has everything after.

@kspurgin
Copy link
Contributor

kspurgin commented May 3, 2021

Ok, yep, so if you have a namespace configured:

p0|http://n2t.net/ark:/99152/p0

And somewhere you have values set up using that namespace:

p0:323gxv8wc

There's only one colon in the value definition, so not a problem.

And this should get mapped out as http://n2t.net/ark:/99152/p0323gxv8wc and not http://n2t.net/ark:/99152/p0/323gxv8wc or something...?

@seth-shaw-unlv
Copy link
Contributor

seth-shaw-unlv commented May 3, 2021

And this should get mapped out as http://n2t.net/ark:/99152/p0323gxv8wc and not http://n2t.net/ark:/99152/p0/323gxv8wc or something...?

Yes. If you want a slash between the namespace and the property, you need to add it to the namespace yourself.

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

No branches or pull requests

4 participants