Giter Club home page Giter Club logo

Comments (2)

alex-randles-ADAPT avatar alex-randles-ADAPT commented on June 21, 2024 1

Hi @arenas-guerrero-julian,

Thank your for the prompt and detailed response.

That makes sense to me. RML views look like a suitable alternative.

I appreciate your help!

from morph-kgc.

arenas-guerrero-julian avatar arenas-guerrero-julian commented on June 21, 2024

Hi @alex-randles-ADAPT,

Thanks for the detailed zip with the example. The output knowledge graph that I get is the following:

@prefix ns1: <http://example.com/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://example.com/1> a rdfs:Resource ;
    ns1:name "Williams",
        "https://example.com/Venus" .

<https://example.com/2> a rdfs:Resource ;
    ns1:name "Smith",
        "https://example.com/John" .

What you are doing in your mapping is to create a template with the entire data value (e.g.: https://example.com/John;Smith) and then splitting by semicolon (you get https://example.com/John<->Smith). In order to get https://example.com/John<->https://example.com/Smith you have to chain two functions, (i) first split the data value, and then (ii) concatenate the data values and the https://example.com/.

Since you are working with CSV, I think its is just easier to use RML views:

@prefix rml: <http://w3id.org/rml/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.com/> .

<#TEST>

	rml:logicalSource [
		rml:query """
                      SELECT Id, UNNEST(STRING_SPLIT(Name, ';')) AS Name FROM 'student.csv'
                """;
		rml:referenceFormulation rml:CSV
	];

	rml:subjectMap [
		rml:template "https://example.com/{Id}" ;
		rml:class rdfs:Resource ;
	] ;

    rml:predicateObjectMap [
        rml:predicate ex:name;
        rml:objectMap [
			rml:template "https://example.com/{Name}";
        ];
    ].

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.