Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV source is interpreted as JDBC and does include undefined #173

Open
TBoonX opened this issue Jul 12, 2022 · 2 comments
Open

CSV source is interpreted as JDBC and does include undefined #173

TBoonX opened this issue Jul 12, 2022 · 2 comments

Comments

@TBoonX
Copy link

TBoonX commented Jul 12, 2022

Issue type: 🐛 Bug

Description

When I define a source which is a csv file, the RML output has JDBC and undefined in the rml:source

Steps

transform the following yarrrml to RML:

prefixes:
  schema: "http://schema.org/"
sources:
  file:
    type: "localfile"
    access: "data.csv"
    referenceFormulation: "csv"
    delimiter: ";"
    iterator: "\n"
mappings:
  test:
    source:
      - file
    s: http://example.com/$(name)
    po:
      - [a, "schema:Person"]
      - ["schema:name", $(value)]

Result:

@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix map: <http://mapping.example.com/> .
@prefix ma: <http://www.w3.org/ns/ma-ont#> .
@prefix schema: <http://schema.org/> .

map:database_000 rdf:type <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#Database> ;
	<http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#jdbcDSN> "data.csv" ;
	<http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#jdbcDriver> "undefined" .

map:map_test_000 rml:logicalSource map:source_000 ;
	rdf:type rr:TriplesMap ;
	rdfs:label "test" ;
	rr:predicateObjectMap map:pom_000, map:pom_001 ;
	rr:subjectMap map:s_000 .

map:om_000 rdf:type rr:ObjectMap ;
	rr:constant "http://schema.org/Person" ;
	rr:termType rr:IRI .

map:om_001 rml:reference "value" ;
	rdf:type rr:ObjectMap ;
	rr:termType rr:Literal .

map:pm_000 rdf:type rr:PredicateMap ;
	rr:constant rdf:type .

map:pm_001 rdf:type rr:PredicateMap ;
	rr:constant schema:name .

map:pom_000 rdf:type rr:PredicateObjectMap ;
	rr:objectMap map:om_000 ;
	rr:predicateMap map:pm_000 .

map:pom_001 rdf:type rr:PredicateObjectMap ;
	rr:objectMap map:om_001 ;
	rr:predicateMap map:pm_001 .

map:rules_000 <http://rdfs.org/ns/void#exampleResource> map:map_test_000 ;
	rdf:type <http://rdfs.org/ns/void#Dataset> .

map:s_000 rdf:type rr:SubjectMap ;
	rr:template "http://example.com/{name}" .

map:source_000 rml:referenceFormulation ql:CSV ;
	rml:source map:database_000 ;
	rdf:type rml:LogicalSource ;
	rdfs:label "file" .


Environment

node -v
v16.15.1

"@rmlio/yarrrml-parser": "^1.3.5"

@pheyvaer
Copy link
Collaborator

pheyvaer commented Jul 12, 2022

Hi @TBoonX

I think the bug is here. This also makes me think that if you remove type: "localfile" you get the expected RML rules.

@TBoonX
Copy link
Author

TBoonX commented Jul 12, 2022

@pheyvaer Removing this line works! Thanks for the hint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants