Project:New Items and Properties: Difference between revisions
Created blank page |
mNo edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
=== Overview === | |||
An '''item''' represents a real world entity, concept, or topic (eg. person, place, publication, event, formula, or abstract concepts). Wikidata items and items in the MaRDI knowledge graph are identified with Q-numbers (i.e, IDs that begin with a Q). | |||
For example, the article "A majorization-minimization algorithm for neuroimage registration" ([[Item:Q6541915]]) is an item in the MaRDI knowledge graph. | |||
A '''property''' defined a relationship between two items or links items to values such as dates or numbers. Wikiddata properties and properties in the knowledge graph are identified with P-numbers (i.e, IDs that begin with a P). | |||
For example, the property "instance of" ([[Property:P31]]) connects an item to the class it belongs to. | |||
Items and properties are tied together using statements, which consist of an item, a property, and a value (which could also be an item) | |||
For example: | |||
"A majorization-minimization algorithm for neuroimage registration" ([[Item:Q6541915]]) -> is an instance of ([[Property:P31]]) -> a scholarly article ([[Item:Q56887]]) | |||
=== Manual Approach === | |||
If you are logged into the MaRDI portal, you can manually create items and properties using the following links/interfaces: | |||
* [[Special:NewItem|Create new item]] | |||
* [[Special:NewProperty|Create new property]] | |||
=== Automated Approach === | |||
To create properties and items from within an importer script (if they are not or can not be 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 inside your script. | |||
=== Additional notes === | |||
* Q-IDs for items that exist in both the MaRDI knowledge graph and Wikidata an be different. For example, the MaRDI Q-ID for "scholarly article" ([[Item:Q56887]]) is different from its Wikidata Q-ID (Q13442814), which is listed as a property on the item's page. | |||
Latest revision as of 16:57, 25 March 2025
Overview
An item represents a real world entity, concept, or topic (eg. person, place, publication, event, formula, or abstract concepts). Wikidata items and items in the MaRDI knowledge graph are identified with Q-numbers (i.e, IDs that begin with a Q).
For example, the article "A majorization-minimization algorithm for neuroimage registration" (Item:Q6541915) is an item in the MaRDI knowledge graph.
A property defined a relationship between two items or links items to values such as dates or numbers. Wikiddata properties and properties in the knowledge graph are identified with P-numbers (i.e, IDs that begin with a P).
For example, the property "instance of" (Property:P31) connects an item to the class it belongs to.
Items and properties are tied together using statements, which consist of an item, a property, and a value (which could also be an item)
For example:
"A majorization-minimization algorithm for neuroimage registration" (Item:Q6541915) -> is an instance of (Property:P31) -> a scholarly article (Item:Q56887)
Manual Approach
If you are logged into the MaRDI portal, you can manually create items and properties using the following links/interfaces:
Automated Approach
To create properties and items from within an importer script (if they are not or can not be 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 inside your script.
Additional notes
- Q-IDs for items that exist in both the MaRDI knowledge graph and Wikidata an be different. For example, the MaRDI Q-ID for "scholarly article" (Item:Q56887) is different from its Wikidata Q-ID (Q13442814), which is listed as a property on the item's page.