Giter Club home page Giter Club logo

Comments (1)

00ade avatar 00ade commented on June 21, 2024 1

Hi! I modified my code and now it works. In particular, I refer to the documentation https://morph-kgc.readthedocs.io/en/stable/documentation/#data-sources and put the reference to the database in the config part as db_url.

-> mapping file:

@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://w3id.org/rml/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix mimic: <http://mimic-translation-project.org/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .

@base <http://mimic-translation-project.org/> .

<T0> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rr:tableName "mimic_untouched.caregivers";
    ];

    rml:subjectMap [
        rr:template "http://mimic-translation-project.org/res/caregiver{cgid}"
    ];
    
    rr:predicateObjectMap [
        rr:predicate mimic:cgId;
        rml:objectMap [
            rr:column "cgid";
            rr:datatype xsd:integer
        ]
    ]; 
    ;

    rr:predicateObjectMap [
        rr:predicate mimic:label;
        rml:objectMap [
            rr:column "label"
        ]
    ];

    rr:predicateObjectMap [
        rr:predicate mimic:description;
        rml:objectMap [
            rr:column "description"
        ];
    ].

->.py file:

import morph_kgc
config = """
   [DataSource1]
   mappings = D:/TIROCINIO/TRANSLATION_CODE/caregivers/caregivers_mapping.ttl
   db_url = postgresql+psycopg://----:------@------:-----/mimic
"""
graph = morph_kgc.materialize(config)
graph.serialize(destination="D:/TIROCINIO/mimic-iii-clinical-database-1.4-ttl/caregivers1.ttl")  

from morph-kgc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.