Exemple #1
0
def languages_v(app, languages_type):
    """Language vocabulary record."""
    vocabulary_service.create(
        system_identity, {
            "id": "dan",
            "title": {
                "en": "Danish",
                "da": "Dansk",
            },
            "props": {
                "alpha_2": "da"
            },
            "tags": ["individual", "living"],
            "type": "languages"
        })

    vocab = vocabulary_service.create(
        system_identity, {
            "id": "eng",
            "title": {
                "en": "English",
                "da": "Engelsk",
            },
            "tags": ["individual", "living"],
            "type": "languages"
        })

    Vocabulary.index.refresh()

    return vocab
Exemple #2
0
def title_type_v(app, title_type):
    """Title Type vocabulary record."""
    vocabulary_service.create(
        system_identity, {
            "id": "subtitle",
            "props": {
                "datacite": "Subtitle"
            },
            "title": {
                "en": "Subtitle"
            },
            "type": "titletypes"
        })

    vocab = vocabulary_service.create(
        system_identity, {
            "id": "alternative-title",
            "props": {
                "datacite": "AlternativeTitle"
            },
            "title": {
                "en": "Alternative title"
            },
            "type": "titletypes"
        })

    Vocabulary.index.refresh()

    return vocab
def resource_type_v(app, resource_type_type):
    """Resource type vocabulary record."""
    vocabulary_service.create(
        system_identity,
        {  # create base resource type
            "id": "image",
            "props": {
                "csl": "figure",
                "datacite_general": "Image",
                "datacite_type": "",
                "openaire_resourceType": "25",
                "openaire_type": "dataset",
                "eurepo": "info:eu-repo/semantic/other",
                "schema.org": "https://schema.org/ImageObject",
                "subtype": "",
                "subtype_name": "",
                "type": "image",
                "type_icon": "chart bar outline",
                "type_name": "Image",
            },
            "title": {
                "en": "Image"
            },
            "type": "resourcetypes"
        })

    vocab = vocabulary_service.create(
        system_identity, {
            "id": "image-photo",
            "props": {
                "csl": "graphic",
                "datacite_general": "Image",
                "datacite_type": "Photo",
                "openaire_resourceType": "25",
                "openaire_type": "dataset",
                "eurepo": "info:eu-repo/semantic/other",
                "schema.org": "https://schema.org/Photograph",
                "subtype": "image-photo",
                "subtype_name": "Photo",
                "type": "image",
                "type_icon": "chart bar outline",
                "type_name": "Image",
            },
            "title": {
                "en": "Photo"
            },
            "type": "resourcetypes"
        })

    Vocabulary.index.refresh()

    return vocab
Exemple #4
0
def resource_type_item(app, resource_type_type):
    """Resource type vocabulary record."""
    rst = vocabulary_service.create(
        system_identity, {
            "id": "image-photo",
            "icon": "chart bar outline",
            "props": {
                "csl": "graphic",
                "datacite_general": "Image",
                "datacite_type": "Photo",
                "eurepo": "info:eu-repo/semantic/image-photo",
                "openaire_resourceType": "25",
                "openaire_type": "dataset",
                "schema.org": "https://schema.org/Photograph",
                "subtype": "image-photo",
                "type": "image",
            },
            "title": {
                "en": "Photo"
            },
            "tags": ["depositable", "linkable"],
            "type": "resourcetypes"
        })

    Vocabulary.index.refresh()

    return rst
Exemple #5
0
def licenses_v(app, licenses):
    """Licenses vocabulary record."""
    vocab = vocabulary_service.create(
        system_identity, {
            "id": "cc-by-4.0",
            "props": {
                "url": "https://creativecommons.org/licenses/by/4.0/legalcode",
                "scheme": "spdx",
                "osi_approved": ""
            },
            "title": {
                "en": "Creative Commons Attribution 4.0 International"
            },
            "tags": ["recommended", "all"],
            "description": {
                "en":
                "The Creative Commons Attribution license allows"
                " re-distribution and re-use of a licensed work on"
                " the condition that the creator is appropriately credited."
            },
            "type": "licenses"
        })

    Vocabulary.index.refresh()

    return vocab
Exemple #6
0
def additional_resource_types(running_app):
    """Resource type vocabulary record."""
    vocabulary_service.create(
        system_identity, {
            "id": "publication",
            "icon": "file alternate",
            "props": {
                "csl": "report",
                "datacite_general": "Text",
                "datacite_type": "",
                "eurepo": "info:eu-repo/semantics/other",
                "openaire_resourceType": "17",
                "openaire_type": "publication",
                "schema.org": "https://schema.org/CreativeWork",
                "subtype": "",
                "type": "publication",
            },
            "title": {
                "en": "Publication"
            },
            "tags": ["depositable", "linkable"],
            "type": "resourcetypes"
        })
    vocabulary_service.create(
        system_identity, {
            "id": "publication-annotationcollection",
            "icon": "file alternate",
            "props": {
                "csl": "report",
                "datacite_general": "Collection",
                "datacite_type": "",
                "eurepo": "info:eu-repo/semantics/technicalDocumentation",
                "openaire_resourceType": "9",
                "openaire_type": "publication",
                "schema.org": "https://schema.org/Collection",
                "subtype": "publication-annotationcollection",
                "type": "publication",
            },
            "title": {
                "en": "Annotation collection"
            },
            "tags": ["depositable", "linkable"],
            "type": "resourcetypes"
        })

    Vocabulary.index.refresh()
Exemple #7
0
def language_item(app, languages_type):
    """Language vocabulary record."""
    return vocabulary_service.create(
        system_identity, {
            "id": "eng",
            "props": {
                "alpha_2": "",
            },
            "title": {
                "en": "English"
            },
            "type": "languages"
        })
def lang(app, lang_type):
    """Language vocabulary record."""
    lang = vocabulary_service.create(
        system_identity, {
            "id": "eng",
            "title": {
                "en": "English",
                "da": "Engelsk",
            },
            "tags": ["individual", "living"],
            "type": "languages"
        })
    return lang
Exemple #9
0
def subject_item(app, subjects_type):
    """Subject vocabulary record."""
    return vocabulary_service.create(
        system_identity, {
            "id": "A-D000008",
            "props": {
                "subjectScheme": "MeSH",
            },
            "title": {
                "en": "Abdominal Neoplasms"
            },
            "type": "subjects"
        })
def relation_type_v(app, relation_type):
    """Relation type vocabulary record."""
    vocab = vocabulary_service.create(
        system_identity, {
            "id": "cites",
            "props": {
                "datacite": "Cites"
            },
            "title": {
                "en": "Cites"
            },
            "type": "relationtypes"
        })

    Vocabulary.index.refresh()

    return vocab
def contributors_role_v(app, contributors_role_type):
    """Contributor role vocabulary record."""
    vocab = vocabulary_service.create(
        system_identity, {
            "id": "other",
            "props": {
                "datacite": "Other"
            },
            "title": {
                "en": "Other"
            },
            "type": "contributorsroles"
        })

    Vocabulary.index.refresh()

    return vocab
def date_type_v(app, date_type):
    """Subject vocabulary record."""
    vocab = vocabulary_service.create(
        system_identity, {
            "id": "other",
            "title": {
                "en": "Other"
            },
            "props": {
                "datacite": "Other"
            },
            "type": "datetypes"
        })

    Vocabulary.index.refresh()

    return vocab
def description_type_v(app, description_type):
    """Title Type vocabulary record."""
    vocab = vocabulary_service.create(
        system_identity, {
            "id": "methods",
            "title": {
                "en": "Methods"
            },
            "props": {
                "datacite": "Methods"
            },
            "type": "descriptiontypes"
        })

    Vocabulary.index.refresh()

    return vocab
def subject_v(app, subject_type):
    """Subject vocabulary record."""
    vocab = vocabulary_service.create(
        system_identity, {
            "id": "A-D000007",
            "props": {
                "subjectScheme": "MeSH",
                "datacite": "Abdominal Injuries"
            },
            "tags": ["mesh"],
            "title": {
                "en": "Abdominal Injuries"
            },
            "type": "subjects"
        })

    Vocabulary.index.refresh()

    return vocab
def resource_type_dataset(resource_type_type):
    """Resource type vocabulary record."""
    return vocabulary_service.create(system_identity, {
        "id": "dataset",
        "props": {
            "csl": "dataset",
            "datacite_general": "Dataset",
            "datacite_type": '',
            "openaire_resourceType": '21',
            "openaire_type": "dataset",
            "schema.org": "https://schema.org/Dataset",
            "subtype": '',
            "subtype_name": '',
            "type": "dataset",
            "type_icon": "table",
            "type_name": "Dataset",
        },
        "title": {
            "en": "Dataset"
        },
        "type": "resource_types"
    })
Exemple #16
0
def resource_type_item(app, resource_type_type):
    """Resource type vocabulary record."""
    return vocabulary_service.create(
        system_identity, {
            "id": "image-photo",
            "props": {
                "csl": "graphic",
                "datacite_general": "Image",
                "datacite_type": "Photo",
                "openaire_resourceType": "25",
                "openaire_type": "dataset",
                "schema.org": "https://schema.org/Photograph",
                "subtype": "image-photo",
                "subtype_name": "Photo",
                "type": "image",
                "type_icon": "chart bar outline",
                "type_name": "Image",
            },
            "title": {
                "en": "Photo"
            },
            "type": "resource_types"
        })
def create_vocabulary_record(data):
    """Create a vocabulary record."""
    vocabulary_service.create(system_identity, data)
Exemple #18
0
 def load_datafile(self, id_, data_file):
     """Load the records form the data file."""
     for record in self.iter_datafile(data_file):
         record['type'] = id_
         # TODO: edit out languages which is not configured by the system
         current_service.create(self._identity, record)