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

@requireAll does not work with @type #165

Open
ioggstream opened this issue Jun 29, 2022 · 0 comments
Open

@requireAll does not work with @type #165

ioggstream opened this issue Jun 29, 2022 · 0 comments

Comments

@ioggstream
Copy link

ioggstream commented Jun 29, 2022

Question

How can I require multiple types?

I expect

frame = {
"@type": {
  @requireAll: true,
  @value: [ skos:Concept, dct:Location ]
}
}

Instead

E Cause: ('Invalid JSON-LD syntax; "@type" value must be a string, an array of strings, or an empty object.',)

Trace

E           pyld.jsonld.JsonLdError: ('Could not expand frame before framing.',)
E           Type: jsonld.FrameError
E           Cause: ('Invalid JSON-LD syntax; "@type" value must be a string, an array of strings, or an empty object.',)
E           Type: jsonld.SyntaxError
E           Code: invalid type value
E           Details: {'value': {'@value': ['http://www.w3.org/2004/02/skos/core#Concept', 'http://publications.europa.eu/ontology/authority/Country', 'http://purl.org/dc/terms/Location']}}  File "~/.local/lib/python3.9/site-packages/pyld/jsonld.py", line 1043, in frame
E               expanded_frame = self.expand(frame, opts)
E             File "~/.local/lib/python3.9/site-packages/pyld/jsonld.py", line 870, in expand
E               expanded = self._expand(active_ctx, None, document, options,
E             File "~/.local/lib/python3.9/site-packages/pyld/jsonld.py", line 2336, in _expand
E               self._expand_object(
E             File "~/.local/lib/python3.9/site-packages/pyld/jsonld.py", line 2542, in _expand_object
E               _validate_type_value(value, options.get('isFrame'))
E             File ~/.local/lib/python3.9/site-packages/pyld/jsonld.py", line 6361, in _validate_type_value
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

1 participant