Group item¶
The purpose of a group item
is to capture and manipulate statements with the same subject with the help of a list of text
, choice
and even other nested group
items.
Reference¶
Key | Explanation |
---|---|
type | Must be "group" for group items. |
id | A unique identity to allow the group item to be reused. The recommendation is to use full URIs. |
label | A multi-language label for the group item. |
editLabel | A multi-language edit label for the group item, has higher priority than label in edit view (if provided). |
description | A multi-language description for the group item. |
editDescription | A multi-language edit description for the group item, has higher priority than label in edit view (if provided). |
text | A set of multi-language texts, parametrized by keys. The keys are typically something like "title", "purpose", "usagenote", "mapping", "example" etc. |
property | A leading property required to be matched for this group item. For example if the group corresponds to a creator of a resource the leading property could be http://purl.org/dc/terms/creator . If the property is left out, the grouping corresponds to the root of an editor, or it is a visual construction (a section) that have no effect on the underlying RDF graph. |
cardinality | See separate section on cardinality. |
constraints | An object with attribute value pairs corresponding to predicate and objects constraints, that is, for a resource to be matched to this group there must exist a corresponding statements for each pair. A common case is to require a type, that is, {"http://www.w3.org/TR/rdf-schema/type": "http://example.com/SomeClass"} . |
nodetype | The RDF nodetype allowed on the object of the matched statement (only used when a property is provided). Only URI, BLANK or RESOURCE is allowed for group items, URI is default. See separate section on nodetypes. |
deps | Dependency path that determines if all statement below this group will be expressed. See separate section on dependency paths. |
styles | An open-ended list of attributes that is used by the different views to control behaviour. See separate section of well supported attributes. |
cls | Array of regular css-classes that will be transferred to the html-structure. |
items | Array of child items, may be group, text or choice items. Loops are not allowed. |
Example¶
{
"id": "author",
"type": "group",
"label": { "en": "Author" },
"description": { "en": "The author of the book" },
"property": "http://purl.org/dc/terms/publisher",
"cardinality": { "min": 0, "max": 5 },
"constraints":{ "http://www.w3.org/TR/rdf-schema/type": "http://xmlns.com/foaf/0.1/Person" },
"nodetype": "RESOURCE",
"styles": ["table"],
"items":[
"firstname",
"surame"
]
}
Binding mechanism¶
A group item can be used to bind existing statements as well as create new statements. The binding step is performed by the RDForms engine that takes an RDF graph, a template and a starting node as input and produces a binding tree as output. Below we describe both the matching and the creation step for statements.
There are three main use cases for matching group items:
- To provide a top-level form for managing statements around a central resource according to an application profile or class. E.g. statements describing a person, a book, a dataset etc.
- To manage a set of statements corresponding to a substructure in a larger form, e.g. an address, a membership, a qualified relation etc.
- A virtual grouping of a set of statements, typically percieved as a section in a form.
Matching statements - case 1¶
In this use case an initial URI has to be provided for the matching process to work. A single binding is created for the URI. If the property, nodetype, pattern or constraints is provided in the group item it is ignored.
All children items in the group will be matched with the URI as subject for further statements.
Matching statments - case 2¶
A binding is created for every statements that matches:
- the subject from the surrounding group
- the given property
- the given nodetype for the object
- the pattern (if any) for the object
- constraints (if provided) must be matched by statements in the graph (where the object of the statement takes the subject position in those constraint statements)
All items that are part of the group will then be matched with the object as the subject for further statements.
Matching statments - case 3¶
This group item is purely for creating a section header. A binding is created, but from a matching perspective it can be ignored and be treated as use case 2 with the only exception that the subject is taken from the group item above.
Creating statements - case 1¶
In this case a binding is created with the initial URI. Any statements created originates from children items.
Creating statements - case 2¶
In this case a binding is created with a statement where:
- the subject is taken from the surrounding group
- the given property of the group item is used
- the nodetype will decide if a URI or a blank node is created for the object (if the nodetype is specified as URI, there must be a child text item without property to provide editing support for it)
- a range of statements will be created to fullfill the constraints
Creating statements - case 3¶
The purpose of the group item is to create a section header. A binding is created, but no statement. Any child items will pick the subject from the surrounding group item.