Project:New Items and Properties: Difference between revisions
From MaRDI portal
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
To create properties | To create properties and items from within an importer script (if they are not imported from Wikidata), you can define them in a json file similar to the one below:<syntaxhighlight lang="json"> | ||
{ | { | ||
"properties": [ | "properties": [ | ||
| Line 29: | Line 29: | ||
] | ] | ||
} | } | ||
</syntaxhighlight>the function [https://github.com/MaRDI4NFDI/docker-importer/blob/fd37ea6b1f8da7b19799891f33ceae0e215a0913/mardi_importer/mardi_importer/zenodo/ZenodoSource.py#L61 create_local_entities()] is a template for how to use the json file to create new entities and properties | </syntaxhighlight>the function [https://github.com/MaRDI4NFDI/docker-importer/blob/fd37ea6b1f8da7b19799891f33ceae0e215a0913/mardi_importer/mardi_importer/zenodo/ZenodoSource.py#L61 create_local_entities()] is a template for how to use the json file to create new entities and properties. | ||
Revision as of 12:37, 12 March 2025
To create properties and items from within an importer script (if they are not imported from Wikidata), you can define them in a json file similar to the one below:
{
"properties": [
{
"label": "community",
"description": "The community this item is connected to, e.g. some science framework such as SFB1234 or MATH+",
"datatype": "wikibase-item"
},
{
"label": "MaRDI profile type",
"description": "defines the types of MaRDI profiles expected to work for this item",
"datatype": "wikibase-item"
},
{
"label": "Internal Project ID",
"description": "An identifier for a project, e.g. from a community such as MATH+ or SFB1234",
"datatype": "wikibase-item"
}
],
"items": [
{
"label": "MaRDI community profile",
"description": "type of MaRDI profile"
},
{
"label": "MaRDI dataset profile",
"description": "type of MaRDI profile"
}
]
}
the function create_local_entities() is a template for how to use the json file to create new entities and properties.