Code Monkey home page Code Monkey logo

Comments (10)

gkellogg avatar gkellogg commented on September 28, 2024

Line 322 is a call to Kernel.open.

rdf/lib/rdf/util/file.rb

Lines 322 to 330 in a083623

Kernel.open(url_no_frag_or_query, "r", **options) do |file|
document_options = {
base_uri: filename_or_url.to_s,
charset: file.external_encoding.to_s,
code: 200,
content_type: content_type,
last_modified:file.mtime,
headers: {content_type: content_type, last_modified: file.mtime.xmlschema}
}

So, it seems the error is that the format of the path you're giving to Kernel.open (/C:/Tools/rubyinstaller-3.1.1-1-x64/bin/1.csv-metadata.json) needs to be something that Ruby on Windows can handle. Perhaps without the leading /? I'm afraid I don't have a windows system available to me for testing.

from rdf.

gkellogg avatar gkellogg commented on September 28, 2024

Depending on the table reference in 1.csv-metadata.json, it could be that there's some errant code that expands it to a non-relative path, but it would likely use File.expand_path. Sorry I can't be of more immediate help, but if you can identify where it needs to do something different, I'd be happy to look further.

from rdf.

jakubklimek avatar jakubklimek commented on September 28, 2024

That slash at the beginning of the path definitely seems suspect. Unfortunately, I do not code in ruby, so I am not able to debug this efficiently.

from rdf.

gkellogg avatar gkellogg commented on September 28, 2024

Maybe you could send a link to your 1.csv-metadata.json and a couple of lines from the referenced 1.csv, I might be able to see where the code is making assumptions that don't work on MS.

from rdf.

jakubklimek avatar jakubklimek commented on September 28, 2024

I have these files in C:\Tools (but I guess any other windows path would do). I added the .txt extension just so that it can be uploaded to GitHub. I use this in class, so it is not a long file. Just note that the same error is triggered also by just validating the CSV file, even without the JSON descriptor in place - as it crashes on the same error even when just trying to locate the descriptor.

1.csv
1.csv-metadata.json.txt

from rdf.

gkellogg avatar gkellogg commented on September 28, 2024

It will be later next week before I can look into this properly, as I’m actually holiday for the next several days, and I need to figure out an MSWIn environment to use.

from rdf.

jakubklimek avatar jakubklimek commented on September 28, 2024

That is perfectly fine, thank you. Fortunately, there is a couple of workarounds:

  1. Use WSL (Windows Subsystem for Linux) or a Linux VM
  2. Upload the files somewhere they get an http(s) based URL - local webserver or GitHub, etc.

from rdf.

gkellogg avatar gkellogg commented on September 28, 2024

There is a fix that addresses this released in RDF.rb 3.2.7, but there is also a change on the develop branch of the rdf-tabular gem. If you can clone the rdf-tabular gem, do a bundle install and try again from that project using bundle exec rdf serialize --input-format tabular 1.csv to see if that fixes the issue.

The problem is that expressed using forward slashes, C:/Tools/rubyinstaller-3.1.1-1-x64/bin/1.csv-metadata.json looks like an absolute URI using the "C" URI scheme. There is a non-standard provision for treating this as a component of the URI path instead (see RFC8089 Appendix E), so I added code for checking absolute or relative IRIs in RDF.rb to include this variation when working on the windows platform, and improved code in rdf-tabular for checking for relative IRIs.

from rdf.

jakubklimek avatar jakubklimek commented on September 28, 2024

@gkellogg Thank you, I can confirm that it works with the code from develop.

from rdf.

gkellogg avatar gkellogg commented on September 28, 2024

Great, I’ll release an update of rdf-tabular tomorrow.

from rdf.

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.