Project:New Items and Properties: Difference between revisions

From MaRDI portal
Rim (talk | contribs)
Created blank page
 
Rim (talk | contribs)
No edit summary
Line 1: Line 1:
 
To create properties ad 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": [
        {
            "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"
        }
    ]
}
</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:34, 12 March 2025

To create properties ad 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