-
Notifications
You must be signed in to change notification settings - Fork 70
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
Comments
Adam pointed at this as the place to fix: https://github.com/Islandora/jsonld/blob/b7acb80a8793a35f3d688acbf12c9334a9fc59b8/src/Normalizer/NormalizerBase.php#L60 |
PR is in |
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:
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. |
I think realistically the only Wikidata namespaces I can imagine being used in metadata in Islandora are P/Property and Q. |
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! |
Oh, ha! Islandora is a development partner of N2T.net so we should probably make sure we support their patterns of things. |
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. |
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...? |
Yes. If you want a slash between the namespace and the property, you need to add it to the namespace yourself. |
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 gotwikidate:Property
instead ofwikidate: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.The text was updated successfully, but these errors were encountered: