Coder Social home page Coder Social logo

rdf-dereference.js's People

Contributors

greenkeeper[bot] avatar jeswr avatar renovate-bot avatar renovate[bot] avatar rubensworks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rdf-dereference.js's Issues

Allow users to pass Comunica context through the library

The RdfDereferencerBase passes options of type IDereferenceOptions to the cbrd:Bus/RdfDereference via the mediate function as the context.

See here:

return this.mediatorRdfDereference.mediate({
context: ActionContext(options),
headers: options.headers,
method: options.method,
url,
});

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

  • Making IDereferenceOptions a broader type (e.g. extending 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 objects
  • Adding a separate context 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.

Fix default export with any type

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.

Expose more control

Some small useful features for this tool:

  • Allow custom headers to be passed.
  • Return the received headers.
  • Return the used content type.
  • Lenient-mode

This will require some additions to Comunica's RDF dereference bus.

Document needed polyfills for webpack 5

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.

Action Required: Fix Renovate Configuration

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)

Unable to run README examples

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"
  }
}

An in-range update of @comunica/actor-rdf-dereference-http-parse is breaking the build 🚨

The dependency @comunica/actor-rdf-dereference-http-parse was updated from 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.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/n3 is breaking the build 🚨

The devDependency @types/n3 was updated from 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.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
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

  • Check this box to trigger a request for Renovate to run again on this repository

Support for microdata?

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?

Document differences between Node.js version and browser version

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!

An in-range update of webpack is breaking the build 🚨

The devDependency webpack was updated from 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.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.42.0

Bugfixes

  • Disable constant replacements in "use asm" scope
  • Update schema to disallow functions for output.hotUpdateChunkFilename as this doesn't work
  • Hoist exports in concatenated module to handle circular references with non-concatenated modules correctly
  • Flag all modules as used in DLLs to fix missing exports
Commits

The 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

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Question: dereference JSON-LD document without dereferencing its contexts?

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 @contexts 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?

Polyfill the `process`

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:

  1. Add a process polyfill here; and also in other libraries that will be affected such as rdf-parse, rdf-serialize etc.
  2. Add the polyfill to every comunica actor that references the process or uses the readable-stream library.

Fails to parse certain triples with JSON-LD

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:
image

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:
image

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"

Sink interface?

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?

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.