Skip to content

Fonds

A fonds recordtype will need the following properties.

Mark the recordtype as "Fonds" recordtype.

1
2
3
4
5
recordtypes:Fonds
    a                    memorix:Recordtype, sh:NodeShape ;
    rdfs:label           "Fonds" ;
    dc:identifier        "Fonds" ;
    memorix:typeOf       memorix:Fonds ;

Mark a string field as the identifier.

sh:property     [
    # Mark the field as the fonds identifier
    memorix:typeOf   memorix:Identifier ;
    rdfs:label       "Fonds identifier"@en ;
    sh:path          fonds:id ;
    sh:group         fonds:DisplayGroup ;
    sh:datatype      xsd:string ;
    sh:minCount      1 ;
    sh:maxCount      1 ;
] ;

Optionally it's possible to create a "File" tab on the Fonds record to manage the files records, and a "Series" tabs to manage the series and files in a traditional hierarchical way.

File tab

This tab will show the child records of type file.

1
2
3
4
5
6
7
8
memorix:hasInformationComponent [
    a memorix:HasRecordsComponent ;
    # Title of the tab
    dc:title "Files";
    memorix:hasRecordType recordtypes:File ;
    # Field in the File recordtype with the current Fonds record as parent
    memorix:path file:fonds ;
] ;

"Files tab"

Serie tab

To manage the series / file relation through a tree add the folowing configuration, replace the recordtype memorix:hasRecordType with the links to the correct recordtypes. replace the memorix:path values with the correct field of the recordtype.

# Info to render the tree UI
    memorix:hasInformationComponent [
        a memorix:TreeComponent ;
        # Title of the tab
        dc:title "Series";
        # Branches of the tree
        memorix:hasNode [
            memorix:hasRecordType recordtypes:Serie ;
            # Fields to display in the tree node, only direct paths of type string are supported.
            memorix:inlineField [
              memorix:path serie:id;
              memorix:order 1.0;
            ];
            memorix:inlineField [
                memorix:path serie:title;
                memorix:order 2.0;
            ];
        ];
        # Leaf nodes of the tree
        memorix:hasLeaf [
            memorix:hasRecordType recordtypes:File ;
            # Field in the File recordtype with the current Fonds record as parent
            memorix:path file:fonds ;            
            # Optional display non editable field as a row in the interface
            memorix:field [
                rdfs:label     "Date (text)"@en , "Datum (tekst)"@nl;
                memorix:path serie:date;
                memorix:order 1.0;
            ];
        ] ;
    ];

"Tree tab"

Custom columns

It's possible to display configured fields as a column in the grid, this can be achieved by adding a configuration as below.

memorix:hasInformationComponent [
    # Leaf nodes of the tree
    memorix:hasLeaf [            
        # Optional display non editable group field as a row in the interface
        memorix:field [
            rdfs:label     "Date (text)"@en , "Datum (tekst)"@nl;
            memorix:order  2.0;
            memorix:path   ( rico:isAssociatedWithDate rico:expressedDate ) ;
        ];
        # Non editable fields to display multiple types are supported.
        memorix:field [
            memorix:path serie:date;
            memorix:order 3.0;
        ];
    ] ;
];

"Custom field"

Leaf custom order

It's possible to provide additional configuration to sort the files in a serie on a custom field.

1
2
3
4
5
6
7
8
9
memorix:hasInformationComponent [
    # Leaf nodes of the tree
    memorix:hasLeaf [            
        # Additional order field, by default ordering will be done on order / identifier
        memorix:orderField [
            memorix:path file:order;
        ] ;
    ] ;
];
Here the file:order path points to the order field in the "File" recordtype.

Reference Fonds recordType

Below is a basic implementation of Fonds recordtype.

@prefix dc:              <http://purl.org/dc/elements/1.1/> .
@prefix sh:              <http://www.w3.org/ns/shacl#> .
@prefix rdf:             <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:            <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dash:            <http://datashapes.org/dash#> .
@prefix xsd:             <http://www.w3.org/2001/XMLSchema#> .
@prefix skos:            <http://www.w3.org/2004/02/skos/core#> .
@prefix html:            <http://www.w3.org/1999/xhtml/> .
@prefix memorix:         <http://memorix.io/ontology#> .
@prefix recordtypes:     </resources/recordtypes/> .
@prefix memorix:         <http://memorix.io/ontology#> .
@prefix fonds:           </resources/recordtypes/Fonds#> .
@prefix file:            </resources/recordtypes/File#> .
@prefix serie:           </resources/recordtypes/Serie#> .

recordtypes:Fonds
    a                    memorix:Recordtype, sh:NodeShape ;
    rdfs:label           "Fonds" ;
    rdfs:comment         "Fonds recordtype" ;
    dc:identifier        "Fonds" ;
    sh:closed            true ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:targetClass       recordtypes:Fonds ;
    memorix:typeOf       memorix:Fonds ;
    # Info to render the tree UI
    memorix:hasInformationComponent [
        a memorix:TreeComponent ;
        # Title of the tab
        dc:title "Series";
        # Branches of the tree
        memorix:hasNode [
            memorix:hasRecordType recordtypes:Serie ;
            # Fields to display in the tree node, only direct paths of type string are supported.
            memorix:inlineField [
              memorix:path serie:id;
              memorix:order 1.0;
            ];
            memorix:inlineField [
                memorix:path serie:title;
                memorix:order 2.0;
            ];
        ];
        # Leaf nodes of the tree
        memorix:hasLeaf [
            memorix:hasRecordType recordtypes:File ;
            # Field in the File recordtype with the current Fonds record as parent
            memorix:path file:fonds ;
        ] ;
    ];
    # Info to render the "File" tab with child records
    memorix:hasInformationComponent [
        a memorix:HasRecordsComponent ;
        # Title of the tab
        dc:title "Files";
        memorix:hasRecordType recordtypes:File ;
        # Field in the File recordtype with the current Fonds record as parent
        memorix:path file:fonds ;
    ] ;
    sh:property          [ memorix:typeOf   memorix:Identifier ;
                           rdfs:label       "Fonds identifier"@en ;
                           html:placeholder "Enter a fonds identifier"@en ;
                           sh:path          fonds:id ;
                           memorix:inTitleAt 1.0 ;
                           sh:order         1.0 ;
                           sh:message       "Fonds identifier should not be empty"@en ;
                           sh:group         fonds:DisplayGroup ;
                           dash:editor      dash:TextFieldEditor ;
                           sh:datatype      xsd:string ;
                           sh:minCount      1 ;
                           sh:maxCount      1 ; ] ;
    sh:property          [ rdfs:label        "Title" ;
                           sh:path           fonds:title ;
                           memorix:inTitleAt 2.0 ;
                           sh:minCount       1 ;
                           sh:maxCount       1 ;
                           sh:order          2.0 ;
                           sh:message        "Title field is required" ;
                           sh:group          fonds:DisplayGroup ;
                           sh:datatype       xsd:string ;
                           dash:editor       dash:TextFieldEditor ;
                           dash:singleLine   true ; ] ;

fonds:DisplayGroup
    rdf:type   sh:PropertyGroup ;
    rdfs:label "Fonds" ;
    sh:order   1.0
.