gkellogg / rdf-distiller Goto Github PK
View Code? Open in Web Editor NEWTranslate any RDF format to any other using Ruby RDF gems
Home Page: http://rdf.greggkellogg.net/
License: The Unlicense
Translate any RDF format to any other using Ruby RDF gems
Home Page: http://rdf.greggkellogg.net/
License: The Unlicense
Unable to transform https://dokie.li/ . When I select RDFa->JSON-LD and raw:
There is a NoMethodError: undefined method `end_with?' for nil:NilClass
Did I miss an option somewhere? I've tried different formats but no go. RDFa is well-formed and valid as far as I can tell.
I get the same issue with other URLs eg http://csarven.ca/dokieli-rww
See sprocket-based alternatives like sinatra-asset-pipeline and sprockets-helpers.
When checking options such as Show Parser debug information and submitting the form, the option is not kept on form reload. I think it should remain checked for the next form submission (other values like URI or markup do carry over to the form after submission).
Just tried distiller with my FOAF profile, but it doesn't seem to follow 303 redirects:
http://rdf.greggkellogg.net/distiller?uri=http://njh.me/
(there is a seperate problem that my FOAF profile as Turtle is invalid, but I am working on that.
Following up on the recent CSVW issue w3c/csvw#872 - I ran into a similar issue with your RDF distiller, where, e.g.
{
"@context": "https://pod-test.mvcr.gov.cz/otevřené-formální-normy/témata-dizertačních-prací/draft/kontexty/téma-dizertační-práce.jsonld",
"typ": "Téma dizertační práce",
"název": {
"cs": "2D nanomateriály pro detekci polutantů v životním prostředí"
},
"popis": {
"cs": "Práce se soustředí na přípravu 2D materiálů, které budou sloužit k odstraňování škodlivin ze životního prostředí. Cílem je vyvinout účinný materiál/katalyzátor k odstranění nitroaromatických a pesticidních látek v podzemních vodách pomocí elektrochemických a fotoelektrochemických metod. Více na www.nanorobots.cz"
}
}
yields
Failed to parse input document: loading remote context failed: https://pod-test.mvcr.gov.cz/otevřené-formální-normy/témata-dizertačních-prací/draft/kontexty/téma-dizertační-práce.jsonld: URI must be ascii only "https://pod-test.mvcr.gov.cz/otev\u0159en\u00E9-form\u00E1ln\u00ED-normy/t\u00E9mata-dizerta\u010Dn\u00EDch-prac\u00ED/draft/kontexty/t\u00E9ma-dizerta\u010Dn\u00ED-pr\u00E1ce.jsonld"
Any chance of update here?
Some of the options on the web form are non-obvious, and I can't find them in the documentation http://rdf.greggkellogg.net/yard/RDF/Distiller/Application.html (probably because the search is not full-text search but only class/method names). Some of the options have an informative tooltip, but it's not always enough, and others don't have it.
expandContext
: I guess this is context used for expanding? Why do we need a second context for that? ("flatten" and "compact" don't get such option, "expand" and "frame" do). Cant's see it in http://rdf.greggkellogg.net/yard/JSON/LD/Expand.html#expand-instance_methodrdfDirection
: please explain thisThe following come from https://www.w3.org/TR/json-ld11-framing/#framing-keywords. But it'd be very useful if you describe them and link to motivating examples in the spec
explicit
"Only include explicitly declared properties in output"omitDefault
"Omit missing properties from output": what else could you do with missing properties, output them as null
?requireAll
"Require all properties to match": (the further mention of --no-compact-to-relative
is wrong)embed
: please explain thisIf this is already documented, please excuse me and point me to the doc. Cheers!
I am working on ceurws/lod#22 and your great tool is mentioned there with an example:
http://rdf.greggkellogg.net/distiller?command=serialize&url=http:%2F%2Fceur-ws.org%2FVol-2549%2F
how would i get the pure result via curl? I didn't find anything about this in the documentation.
curl "http://rdf.greggkellogg.net/distiller?command=serialize&url=http:%2F%2Fceur-ws.org%2FVol-2549%2F"
returns a html page. The accept header topic is mentioned in two other issues e.g. #11 but i did't find an example
see also https://stackoverflow.com/questions/73385469/how-to-use-rdfdistiller-via-curl
This structure correctly validates:
{
"@context": {
"@vocab": "http://schema.org/"
},
"@type": "Person",
"name": "Delia Derbyshire",
"sameAs": "http://en.wikipedia.org/wiki/Delia_Derbyshire",
"alumniOf": {
"@type": "OrganizationRole",
"alumniOf": {
"@type": "CollegeOrUniversity",
"name": "University of Cambridge",
"sameAs": "http://en.wikipedia.org/wiki/University_of_Cambridge"
},
"startDate": "1959"
}
}
But when I select:
Raw Output
Distiller throws this error:
XML Parsing Error: not well-formed
Location: http://rdf.greggkellogg.net/distiller
Line Number 5, Column 34:
<ns5:OrganizationRole http://www.w3.org/1999/02/22-rdf-syntax-ns#nodeID='b1'>
---------------------------------^
Source:
https://schema.org/OrganizationRole
/jay
I realized almost by chance that the distiller accepts input
as a URL parameter.
It seems a low hanging fruit, then, to add a button to generate a permalink allowing people to share the result of the distiller, on a given example, into a single URL...
STR in http://rdf.greggkellogg.net/distiller:
<ol vocab="http://schema.org/" typeof="ItemList">
<li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="http://www.example.com/dresses">
<span property="title">Dresses</span>
</a>
<meta property="position" content="1">
</li>
› <li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="http://www.example.com/dresses/real">
<span property="title">Real Dresses</span>
</a>
<meta property="position" content="2">
</li>
</ol>
This url works though as ntriples: https://dvcs.w3.org/hg/webschema/raw-file/a4761ed99160/schema.org/drafts/examples/site/testcases/rdfa/sdo_eg_rdfa_1.html
<div itemscope>
<div id="ref">
<div itemprop="name">friend1</div>
<div itemprop="friend" itemscope>
<div itemprop="name">friend2</div>
<div itemprop="friend" itemscope itemref="ref"></div>
</div>
</div>
</div>
This is invalid but crashes the server
Hi Greg,
Not sure where the problem is, here. It maybe with the RDF::Writer? I checked on the Distiller page to make sure that it behaved the same as my code. Here's the problem:
this JSON-LD:
{ "@context": "https://rawcdn.githack.com/ResearchObject/ro-crate/8c85e590155d0e81d47786628838ab25a1035359/docs/1.1-DRAFT/context.jsonld", "@graph": [ { "@id": "ro-crate-metadata.jsonld", "@type": "CreativeWork", "about": { "@id": "./" } }, { "@id": "ro-crate-preview.html", "@type": "CreativeWork", "about": { "@id": "./" } }, { "@id": "./", "@type": "Dataset", "name": [ "Situación de COVID-19 en España" ], "publisher": { "@id": "https://ror.org/00ca2c886" }, "creator": [ { "@id": "https://ror.org/00ca2c886" } ], "url": [ "https://covid19.isciii.es/resources/serie_historica_acumulados.csv" ] } ] }
uses relative paths as its identifiers. the @context does not have a @base (which is good, because the content of these files will move around). However, when I read/write from JSON-LD to Turtle (RDF::Turtle::Writer) it doesn't write anything. Putting the same JSON-LD into the https://json-ld.org/playground/ yields valid RDF, by assuming the base is the local base URI and all relative IDs become relative to that. I have attempted to set base_uri: in the Writer, but it didn't seem to make a difference.
I've run out of troubleshooting ideas. Can you suggest a path forward?
Cheers!
The end of https://github.com/gkellogg/rdf-distiller/blob/master/README.markdown includes at least two broken links:
http://rubygems.org/rdf-portal
https://github.com/gkellogg/rdf-portal
Under "Form URL", user inputs:
URI: http://csarven.ca/.ttl
Input format: rdfa
, Output format: turtle
The Accept
header is sent as application/n-triples, text/plain;q=0.2, application/n-quads, text/x-nquads;q=0.2, application/ld+json, application/x-ld+json, application/rdf+json, text/html;q=0.5, application/xhtml+xml;q=0.7, image/svg+xml;q=0.4, text/n3, text/rdf+n3;q=0.2, application/rdf+n3;q=0.2, text/turtle, text/rdf+turtle, application/turtle;q=0.2, application/x-turtle;q=0.2, application/rdf+xml, text/csv;q=0.4, text/tab-separated-values;q=0.4, application/csvm+json, application/trig, application/x-trig;q=0.2, application/trix, */*;q=0.1
If the server returns Content-Type: text/turtle
, distiller behind the scenes still tries to parse the response body as RDFa. Returns Error:
Errors found during processing
<http://csarven.ca/.ttl>: error parsing attribute name
Tag http: invalid
Tag https: invalid
Tag irc: invalid
Namespace prefix mailto is not defined
Tag mailto:info invalid
There should be an alert to the user that the response was in a serialization format that's different than the input format that was selected in the UI, and maybe suggest that something along the lines of "Expected RDFa but parsing as Turtle". Same goes for any input format and actual Content-Type value.
Trying to use the distiller with the form input method on the website http://www.burny-shop.de/. (view-source in chrome and copy+paste in the markup field). It always returns with
incompatible character encodings: ASCII-8BIT and UTF-8
I have this issue on a lot of sites and it was introduced in 1.1.11 o2 1.1.12. I didn't have this before. It seems to be the following line that makes this happen:
<a href="?ObjectPath=/Shops/62542650/Categories/Zubeh%C3%B6r">Zubehör</a>
You can just copy+paste this line in the markup box to see the problem in action
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.