ontolutils.classes.thing.Thing.from_jsonld
- classmethod Thing.from_jsonld(source: Optional[Union[str, Path]] = None, data: Optional[Union[Dict, str]] = None, limit: Optional[int] = None, context: Optional[Dict] = None)
Initialize the class from a JSON-LD source
Note the inconsistency in the schema.org protocol. Codemeta for instance uses http whereas https is the current standard. This repo only works with https. If you have a http schema, this method will replace http with https.
- source: Optional[Union[str, pathlib.Path]]=None
The source of the JSON-LD data (filename). Must be given if data is None.
- data: Optional[Union[str, Dict]]=None
The JSON-LD data as a str or dictionary. Must be given if source is None.
- limit: Optional[int]=None
The limit of the number of objects to return. If None, all objects will be returned. If limit is 1, then the first object will be returned, else a list of objects.
- context: Optional[Dict]=None
The context to use for the JSON-LD serialization. If a string is given, it will be interpreted as an import statement and will be added to the context.