rubensworks / rdf-dereference.js Goto Github PK
View Code? Open in Web Editor NEWDereference any URL for its RDF contents
License: MIT License
Dereference any URL for its RDF contents
License: MIT License
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>rubensworks/renovate-presets:js)
This is probably an issue with the JSON-LD streaming parser, but I put the issue here for the reproducability.
I publish a LD document (https://lodi.ilabt.imec.be/coghent/dmg/objecten?generatedAtTime=2021-05-21T17:12:34.363Z)
that contains information about subject https://stad.gent/id/mensgemaaktobject/dmg/530026423/2021-05-21T17:12:34.363Z and contains a link to its Production activity:
Following triple should be parsed:https://stad.gent/id/mensgemaaktobject/dmg/530026423/2021-05-21T17:12:34.363Z http://www.cidoc-crm.org/cidoc-crm/P108i_was_produced_by _:b0
In the JSON-LD playground, this works:
When I run rdf-dereference to use the RDF parser, I don't retrieve this triple:
rdf-dereference https://lodi.ilabt.imec.be/coghent/dmg/objecten?generatedAtTime=2021-05-21T17:12:34.363Z | grep "https://stad.gent/id/mensgemaaktobject/dmg/530026423/2021-05-21T17:12:34.363Z" | grep "produced"
It seems like the default export should be of the type: RdfDereferencer
instead of any
It may not be possible as it seems you're doing some component magic with engine-default.js
in the prepare
script.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@types/jest
, jest
, ts-jest
)package.json
@comunica/actor-dereference-fallback ^2.0.2
@comunica/actor-dereference-file ^2.0.2
@comunica/actor-dereference-http ^2.0.2
@comunica/actor-dereference-rdf-parse ^2.6.0
@comunica/actor-http-fetch ^2.0.1
@comunica/actor-http-proxy ^2.0.1
@comunica/actor-rdf-parse-html ^2.0.1
@comunica/actor-rdf-parse-html-microdata ^2.0.1
@comunica/actor-rdf-parse-html-rdfa ^2.0.1
@comunica/actor-rdf-parse-html-script ^2.0.1
@comunica/actor-rdf-parse-jsonld ^2.0.1
@comunica/actor-rdf-parse-n3 ^2.0.1
@comunica/actor-rdf-parse-rdfxml ^2.0.1
@comunica/actor-rdf-parse-shaclc ^2.6.0
@comunica/actor-rdf-parse-xml-rdfa ^2.0.1
@comunica/bus-dereference ^2.0.2
@comunica/bus-dereference-rdf ^2.0.2
@comunica/bus-http ^2.0.1
@comunica/bus-init ^2.0.1
@comunica/bus-rdf-parse ^2.0.1
@comunica/bus-rdf-parse-html ^2.0.1
@comunica/config-query-sparql ^2.0.1
@comunica/context-entries ^2.8.1
@comunica/core ^2.0.1
@comunica/mediator-combine-pipeline ^2.0.1
@comunica/mediator-combine-union ^2.0.1
@comunica/mediator-number ^2.0.1
@comunica/mediator-race ^2.0.1
@rdfjs/types *
process ^0.11.10
rdf-string ^1.6.0
stream-to-string ^1.2.0
@comunica/runner ^2.0.3
@comunica/types ^2.8.1
@types/jest ^27.0.0
@types/n3 ^1.10.3
arrayify-stream ^1.0.0
componentsjs-generator ^3.0.1
jest ^27.0.1
jest-rdf ^1.7.0
manual-git-changelog ^1.0.1
pre-commit ^1.2.2
rdf-data-factory ^1.1.0
rdf-quad ^1.5.0
streamify-string ^1.0.1
ts-jest ^27.0.1
tslint ^6.0.0
tslint-eslint-rules ^5.3.1
typescript ^4.0.0
webpack ^5.0.0
webpack-cli ^5.0.0
The RdfDereferencerBase
passes options
of type IDereferenceOptions
to the cbrd:Bus/RdfDereference
via the mediate
function as the context.
See here:
rdf-dereference.js/lib/RdfDereferencerBase.ts
Lines 25 to 30 in 645a126
Since the context exposes a variety of options for users to configure Comunica, such as an HTTP proxy for example, which is quite relevant to rdf-dereference
, it makes sense for users to be able to provide the context to rdf-dereference
.
That could be achieved by
IDereferenceOptions
a broader type (e.g. extend
ing it to include Record<string, any>
) It would have to be that wide because not all context options are simple strings, some are functions or objectscontext
field to the IDereferenceOptions
and passing that as the context to mediate
Of course, users could simply override Typescript to pass the context as they want currently as additional fields on the option
argument, but this would make it explicit and indicate to users that it is a valid option.
As of comunica/comunica@cbf47cc Comunica polyfills the process for query engines. However, rdf-dereference does not perform this polyfill which results in "process not defined" errors when trying to rdf-dereference with the default webpack config for Angular.
As far as I see it there are 2 ways of going about a solution:
process
or uses the readable-stream
library.1.9.2
to 1.9.3
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
@comunica/actor-rdf-dereference-http-parse is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Thank you for this library. I am new to the LOD landscape and am going through https://www.rubensworks.net/blog/2019/10/06/using-rdf-in-javascript/.
I am trying to run the examples in the README.
In particular:
import rdfDereferencer from "rdf-dereference";
const { data } = await rdfDereferencer.dereference("http://dbpedia.org/page/12_Monkeys");
data
.on("data", (quad) => console.log(quad))
.on("error", (error) => console.error(error))
.on("end", () => console.log("Done."));
I get a TypeError: rdfDereferencer.dereference is not a function
.
Content of my package.json:
{
"type": "module",
"dependencies": {
"fs": "^0.0.1-security",
"n3": "^1.17.0",
"rdf-data-factory": "^1.1.2",
"rdf-dereference": "^2.1.0"
}
}
Some small useful features for this tool:
This will require some additions to Comunica's RDF dereference bus.
1.1.3
to 1.1.4
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
@types/n3 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
I'd like to pass the CLI interace a (possibly relative) path to a local HTML or RDF file.
Hi @rubensworks, are you planning to also support microdata? Would you appreciate a PR to add this? Or can you recommend another library to also get microdata from html?
Many pages include triples in various formats, e.g. RDFa/microdata and JSON-LD at the same time.
It would be great to have an option that annotated each triple with the plugin source it came from both in the TS library and the CLI tool.
Thanks for so many awesome projects!
I use this package - with great pleasure - to dereference IRIs of JSON-LD documents. However, I find the dereferencing to be a bit slow, e.g. when using this IRI.
I get the impression that this package not only dereferences the actual IRIs, but also the IRIs that are mentioned in the @context
s of the JSON-LD documents. Is that correct? Or when looking at the sample IRI: does it request the @context
IRIs, http://iiif.io/api/presentation/2/context.json
and http://iiif.io/api/image/2/context.json
? If so, is it possible to disable this?
I wanted to try the parser for getting back embedded JSON-LD in a HTML webpage, as it's done for SEO all the time.
Now I'm a bit confused as I cannot find a Sink interface that I would need for that, as you did in any other parsers. Am I missing something here?
Here's the result of rdf-dereference http://schema.org/Person
.
Then I do the same thing in the browser and get this, which is significantly less and missing many of the triples I need.
I'm wondering if the downstream communica packages have different behaviors in Node than the browser, because I looked at the difference between RdfDereferencer-browser.ts
and RdfDereferencer.ts
, and there's not much. It would be great to put that in documentation somewhere.
Thanks!
This package also works out-of-the-box in browsers via tools such as webpack
I think this is not totally true anymore for webpack 5, since many polyfills got removed and need to be added explicitely. It would be helpful if rdf-dereference documented what exact polyfills are needed.
From what I know this is at least stream-browserify
, which needs to be installed and added in webpack config via
resolve: {
fallback: {
stream: require.resolve('stream-browserify'),
},
}
After doing so I ran into a runtime error "_stream_readable.js:561 Uncaught ReferenceError: process is not defined", which I could get rid of by installing process
and adding a polyfill via ProvidePlugin:
plugins: [
new ProvidePlugin({
process: 'process',
}),
]
But I noticed a problem with dereferencing JSON-LD data then. From a html resource containing both rdf-a and JSON-LD the stream only contained the rdf-a data then. So I am probably missing something else.
4.41.6
to 4.42.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
"use asm"
scopeoutput.hotUpdateChunkFilename
as this doesn't workThe new version differs by 11 commits.
29d851b
4.42.0
07a4b28
Merge pull request #10478 from webpack/bugfix/all-modules-dll
c1aa9d4
flag all modules as used for Dll
d147689
Merge pull request #10431 from webpack/bugfix/concat-circular-4
d76761d
hoist exports to the top of a concatenated module
534d78f
Merge pull request #10393 from webpack/schema/disallow-function-hotchunkfilename
d46ddc2
disallow function for output.hotUpdateChunkFilename
95409bd
Merge pull request #10294 from ngg/asmjs-4
7a30012
spacing
284e97f
add detectStrictMode method for backward-compat
a7a07bc
do not evaluate constants in asm.js, fix IIFE mode detection
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Create a variant of this package where the HTTP actor is replaced with the Solid-enabled HTTP actor, so that authenticated requests can be done.
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.