Skip to content
Snippets Groups Projects
Select Git revision
  • 8b33c737355a47252b05ca5a8011cf9061fd0676
  • master default protected
  • demo2-latest
  • fml40-to-aas
  • demo2-lastest
  • demo_spec
  • beschreibungen
  • beschreibungen_test
  • beschreibungen-patch-7485
  • beschreibungen-patch-4121
  • docker-dzwald
  • model/status_zu_faellende_baeume
12 results

docker-compose.yml

Blame
  • ContextDefinitions.ts 2.44 KiB
    import ComponentInformation from "../entity/ComponentInformation";
    
    const component = {
        "id": { "@id": "https://schema.org/url", "@type": "@id"},
        "dateCreated": "https://schema.org/dateCreated",
        "license": "https://www.w3.org/1999/xhtml/vocab#license"
    };
    
    const componentRelation = {
        "id": { "@id": "https://schema.org/url", "@type": "@id"},
        "from": "https://schema.org/DateTime",
        "to": "https://schema.org/DateTime",
        "license": "https://www.w3.org/1999/xhtml/vocab#license"
    };
    
    const information = function(metadataContext: unknown, previousVersion: ComponentInformation | undefined, nextVersion: ComponentInformation | undefined): Record<string, unknown> {
        const result: Record<string, unknown> = {
            "id": { "@id": "https://schema.org/url", "@type": "@id"},
            "component": { "@id": "https://schema.org/url", "@type": "@id"},
            "dateCreated": "https://schema.org/dateCreated",
            "name": "https://schema.org/name",
            "comment": "https://schema.org/comment",
            "informationLicense": "https://www.w3.org/1999/xhtml/vocab#license",
            "measurementLicense": "https://www.w3.org/1999/xhtml/vocab#license",
            "topic": "https://schema.org/text",
            "prov" : "http://www.w3.org/ns/prov#"
        };
    
        if(previousVersion) {
            result.previousVersion = { "@id": "https://schema.org/url", "@type": "@id"};
        }
    
        if(nextVersion) {
            result.nextVersion = { "@id": "https://schema.org/url", "@type": "@id"};
        }
    
        return result;
    };
    
    const measurement = function(valueContext: unknown, metadataContext: unknown | undefined): Record<string, unknown> {
        const result: Record<string, unknown> = {
            "prov" : "http://www.w3.org/ns/prov#",
            "id": { "@id": "https://schema.org/url", "@type": "@id"},
            "dateCreated": "https://schema.org/dateCreated",
            "license": "https://www.w3.org/1999/xhtml/vocab#license",
            "value": valueContext
        };
    
        if(metadataContext) {
            result.metadata = metadataContext;
        }
    
        return result;
    };
    
    const typeDefinition = {
        "name": { "@id": "https://schema.org/url", "@type": "@id"},
        "dateCreated": "https://schema.org/dateCreated",
        "comment": "https://schema.org/comment",
        "schema": "https://json-schema.org/draft/2020-12/json-schema-core.html",
        "license": "https://www.w3.org/1999/xhtml/vocab#license",
    };
    
    export default {
        component, 
        componentRelation, 
        information, 
        measurement,
        typeDefinition
    };