Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 20:12
    renovate[bot] edited #854
  • 20:12
    renovate[bot] edited #1110
  • 20:12
    renovate[bot] edited #1110
  • 18:25
    coveralls commented #1110
  • 18:11
    renovate[bot] edited #854
  • 18:11
    renovate[bot] synchronize #1110
  • 18:11

    renovate[bot] on typescript-eslint-monorepo

    Update dependency @typescript-e… (compare)

  • 16:58
    jitsedesmet review_requested #162
  • 16:17
    jitsedesmet commented #162
  • 16:16
    coveralls commented #162
  • 16:13
    jitsedesmet opened #162
  • 07:41
    rubensworks labeled #159
  • Nov 28 14:01
    renovate[bot] commented #955
  • Nov 28 07:17
    rubensworks commented #1010
  • Nov 28 06:30
    rubensworks commented #1044
  • Nov 27 13:17
    jeswr opened #161
  • Nov 26 15:50
    andrewzhurov commented #1044
  • Nov 26 15:49
    andrewzhurov commented #1044
  • Nov 26 15:37
    andrewzhurov opened #1125
  • Nov 25 23:43
    jaxoncreed commented #1010
Daniel Beeke
@danielbeeke
Hi all, I am working on a way to directly put LDflex paths into a template layer (uHTML). In this process I am bundling queries into one with the LDflex preload handler. Here is a demo: https://uhtml-ldflex.danielbeeke.nl/ At the moment I am not using Comunica. I am directly fetching the sparql results (and then LDflex does the rest) so the browser build is small. In the future I want this library to be pluggable so that you could use Comunica.
Ruben Taelman
@rubensworks
Looks neat!
Daniel Beeke
@danielbeeke

I am wondering if this concept exists:
A SPARQL rewrite that always forces INSERT / UPDATE queries to put triples into named graphs that have the name of the document subject.

I want to do access control via the named graphs. I want to put all triples that belong to one document into one named graph where the name of the graph is identical to the subject.
The difficulty for me is detecting where the document starts.

To make it myself I started with sparql.js. Are there things that could help me or that I should be aware of?

7 replies
Daniel Beeke
@danielbeeke

Here you can see what I mean: https://github.com/danielbeeke/flatty/blob/master/src/middlewares/ForceGraph/ForceGraph_test.ts

This works for this specific query. And probably some more

Karel Klíma
@karelklima

Hello, I am creating a library to query Linked Data in ORM style called
LDkit. The purpose of the library is to make it easier for
front end developers to display and modify data in user-facing applications.

The reason I am writing here is that besides being built upon RDF/JS standards,
LDkit is compatible with Comunica - you can use any Comunica-based engine with
LDkit as means to retrieve and modify RDF data. If you find LDkit interesting, I
would appreciate if you include it in the Comunica
Usage showcase

To query data using LDkit, you need to specify a data source (e.g. a SPARQL
endpoint) and a data schema, which is roughly what data model stands for in
ORM systems. The schema defines shape of the data that you want to query (e.g.
rdf:type of entities, their properties and types of properties). Having done
that, you can then use this data schema to query for data that match that
schema. LDkit will create appropriate SPARQL queries and converts RDF data into
JavaScript / TypeScript native format.

To better ilustrate the idea, here is a simple example of how LDkit works:

import { type Context, createResource } from "ldkit";
import { dbo, rdfs, xsd } from "ldkit/namespaces";

const context: Context = {
  sources: ["https://dbpedia.org/sparql"],
};

const PersonSchema = {
  "@type": dbo.Person,
  name: rdfs.label,
  abstract: dbo.abstract,
  birthDate: {
    "@id": dbo.birthDate,
    "@type": xsd.date,
  },
} as const;

const Persons = createResource(PersonSchema);

const adaIri = "http://dbpedia.org/resource/Ada_Lovelace";
const ada = await Persons.findByIri(adaIri);

console.log(ada.name); // `string` Ada Lovelace
console.log(ada.birthDate); // `Date` 1815-12-10

The biggest differentiator between LDkit and similar existing tools (like
LDflex) is focus on developer experience and an ambition to enable even users
inexperienced with RDF to build applications using Linked Data. Data schemas and
conversion in LDkit are fully typed, meaning that if you specify a schema with a
property of type xsd:date, your IDE will hint you that the resulting value
will be of type Date. In other words, the only moment when you as a developer
need to work with RDF is while creating a data schema. After that you only work
with native data types.

At this moment, LDkit is being used in one production application, with several
more applications to be launched soon.

I am looking for feedback on how to improve LDkit and for means how to evaluate
its benefits, before eventually (hopefully) publishing a research paper about
it. Comments are more than welcome! Thank you.

Ruben Taelman
@rubensworks
Really nice work @karelklima!
And yes, we can definitely include a link to this on comunica's usage page, feel free to add a link to it via a PR to https://github.com/comunica/website (can be added right after Quadstore)
1 reply
Daniel Beeke
@danielbeeke
@karelklima I like the idea of grouping predicates into one query! I will play with it. Does it already support ordered lists? And blank nodes?
1 reply
Daniel Beeke
@danielbeeke
I have a N3 store with some data that contains blank nodes. After querying with comunica: CONSTRUCT { ?s ?p ?o } WHERE { GRAPH <http://example.com> { ?s ?p ?o } } I get blankNodes that have values like: bc_0_n3-6730. How do I stitch it back together? The quads do not relate to each other.
Should I insert a datafactory somewhere?
Ruben Taelman
@rubensworks
Could in theory be done by disabling localizeBlankNodes in the context (next comunica version, not released yet).
But in any case, if you need to identify blank nodes, then you're better off using named nodes. Because blank node labels only have meaning within one document or query result set.
Daniel Beeke
@danielbeeke

I know, but I have some shacl files that have blank nodes.

But I am not trying to mix two documents I think, or is the CONSTRUCT a new document?

I would expect the construct to give me just the quads that I ask
Ruben Taelman
@rubensworks
Yeah, the SPARQL spec says that bnodes have to be relabelled (which makes sense). So it won't give you the quads as-is. But this can be disabled via localizeBlankNodes.
Daniel Beeke
@danielbeeke
ah okay, I understand. thanks for the information!
Marcelo Machado
@marcelomachado
Hello guys, can I use this channel to talk about LDF/Server as well or is there any other channel?
Marcelo Machado
@marcelomachado
I'm wondering if there is any place with documentation for creating my own datasource. I can easily follow the code of the other datasources. However, I don't really know how to deal with the part related to the Components.js and lerna. Should I create a separate repository from the main Server.js code? And if not, how to deal with the dependency injection files since I don't have this datasource published on npm yet?
Ruben Taelman
@rubensworks
@marcelomachado Sure, feel free to ask questions here.
Documenting that process is something that still needs to be done, but no one got around to doing it yet unfortunately.
Here's an example of an external datasource: https://github.com/mielvds/ldf-datasource-summary/
The dep inj framework doesn't necessarily require things to be published on npm, so you can do things locally.
Marcelo Machado
@marcelomachado
I see... Well, this could be an opportunity for me to help with the documentation. But I will probably need help at some points. I'm still getting familiar with the projects.
Marcelo Machado
@marcelomachado
I've just created this project: https://github.com/marcelomachado/datasource-jsonld-endpoint
My ideia is to provide access to interfaces that expose data in jsonld, such as ConceptNet.
I am not sure if I did it correct but I manually created some files in the components folder. However, if I don't need to publish it beforehand in npm where this https://github.com/marcelomachado/datasource-jsonld-endpoint/blob/6017bd9bf9181f9e5dba56b68a83644917664e6d/components/Datasource/JsonLdEndpoint.jsonld#L4 kind of lines comes from?
Marcelo Machado
@marcelomachado
And what is the best way to test if no inside the Server.js project?
Ruben Taelman
@rubensworks

if I don't need to publish it beforehand in npm where this https://github.com/marcelomachado/datasource-jsonld-endpoint/blob/6017bd9bf9181f9e5dba56b68a83644917664e6d/components/Datasource/JsonLdEndpoint.jsonld#L4 kind of lines comes from?

If the packages are available in node_modules, the dep inj framework will resolve that URL to the local context, instead of doing the remote lookup.

19 replies

And what is the best way to test if no inside the Server.js project?

You could create your own server package, include the basic server as dep, and your new datasource. The you could copy-paste most of the stuff in https://github.com/LinkedDataFragments/Server.js/tree/master/packages/server

Marcelo Machado
@marcelomachado
Thank you!
vid
@vid:matrix.org
[m]
Is there any relation between components.js and angular schematics?
(besides they both use json-ld and describe systems)
Jesse Wright
@jeswr

I'm fairly sure there is no relation between the two.

Also at a quick glance angular schematics seems to be using json with their own custom schemas but not json-ld. I would be interested in a link to their use of json-ld if there is one.

1 reply
Daniel Beeke
@danielbeeke
Would anyone have pointers to exposing a REST API as an SPARQL endpoint? I want to use this endpoint in queries with Comunica with multiple sources. I am thinking that I could use sparql.js to see if there are filters that I need to execute. I would then fetch the results with the filters. After that I could create an N3 store that holds all the records and then execute the sparql query on the N3 store with Comunica.
2 replies
Martynas Jusevicius
@namedgraph_twitter
Daniel Beeke
@danielbeeke
Thanks!
Daniel Beeke
@danielbeeke
    const response = await myEngine.query(query, { sources: [store] })
    const { data } = await myEngine.resultToString(response, 'application/sparql-results+json')
This gives me a stream that does not end and does only give me one time a bit of data. How do I make sure the stream gives?
Daniel Beeke
@danielbeeke
It might be the same as comunica/comunica#1091
I have changed the query and now it returns content. So some cases give a correct stream, others dont
Daniel Beeke
@danielbeeke
I found a solution to the problem I posted, its very odd though.. I think I messed up some data.
Somehow changing how the jsonld was converted fixed my issue.
Marcelo Machado
@marcelomachado
@rubensworks Do I need to do anything else in LinkedDataFragments/Server.js#168 in order to be merged into master?
Ruben Taelman
@rubensworks
@marcelomachado Will try to look into it this week!
Anton Wiklund
@ixuz
Hi all, joining this room to learn more about Comunica :)
Ruben Taelman
@rubensworks
Welcome @ixuz :wave:
Daniel Beeke
@danielbeeke
Is it possible to use a stream of json-ld objects as a source for Comunica?
I have checked the sources, its not there, but my question is also about the internals, would it be in some far future? Is it a design goal?
Would I see it correct that maybe I could wrap my stream as an RDFjs source?
Ruben Taelman
@rubensworks
Comunica supports parsing from JSON-LD documents.
Represented as a string
So you can convert your objects to string, and then comunica will be able to query over it.
Daniel Beeke
@danielbeeke
Thanks, that would work indeed. Then I would have to wait till it is finished, I was wondering if it could be as a stream. I think the rdfjs.match thing is a stream, would that be an option? Is Comunica actively consuming rdfjs as a stream?
Daniel Beeke
@danielbeeke
ah I see now how it works, that would not work either. Because it wants a specific subset of the data.