Giter VIP home page Giter VIP logo

Comments (4)

rubensworks avatar rubensworks commented on August 11, 2024

Are you certain you're using the latest versions of everything? (how are you invoking this code?) Because if calling graphql-to-sparql.js manually works, then I guess it's a versioning issue.

from graphql-ld.js.

renevds avatar renevds commented on August 11, 2024

@rubensworks
It would seem I had linked the wrong repo in my "interesting note", I made a correction, it should make more sense now.
I'm using GraphQl-LD withinWalder.
I will check if versioning is the problem.

from graphql-ld.js.

pheyvaer avatar pheyvaer commented on August 11, 2024

We are using the latest version:

"graphql-ld": "^1.4.0",
"graphql-ld-comunica": "^1.2.1",

from graphql-ld.js.

pheyvaer avatar pheyvaer commented on August 11, 2024

I've made a failing example

JavaScript:

var Client = require("graphql-ld").Client;
const QueryEngineComunica = require('graphql-ld-comunica').QueryEngineComunica;

main();

async function main() {
// Define a JSON-LD context
  const context = {
    "@context":           {
      "type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
      "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
      "owl": "http://www.w3.org/2002/07/owl#",
      "label": "rdfs:label",
      "comment": "rdfs:comment",
      "domain": "rdfs:domain",
      "range": "rdfs:range",
      "DatatypeProperty": "owl:DatatypeProperty"
    }
  };

// Create a GraphQL-LD client based on a client-side Comunica engine over 2 sources
  const comunicaConfig = {
    sources: ["http://localhost:8080/rml.ttl"],
  };
  const client = new Client({context, queryEngine: new QueryEngineComunica(comunicaConfig)});

// Define a query
  const query = `
              {
              id @single
              type (_:DatatypeProperty)
              label @single
              comment @single
              domain @optional
              range @optional
            }`;

// Execute the query
  const {data} = await client.query({query});

  console.log(data);
}

Data:

@prefix cc:			<http://creativecommons.org/ns#> .
@prefix dcterms:		<http://purl.org/dc/terms/> .
@prefix xsd: 			<http://www.w3.org/2001/XMLSchema#> .
@prefix owl: 			<http://www.w3.org/2002/07/owl#> .
@prefix foaf: 			<http://xmlns.com/foaf/0.1/> .
@prefix ql: 			<http://semweb.mmlab.be/ns/ql#> .
@prefix rml: 			<http://semweb.mmlab.be/ns/rml#> .
@prefix rmlt: 			<http://semweb.mmlab.be/ns/rml-target#> .
@prefix rr: 			<http://www.w3.org/ns/r2rml#> .
@prefix rdf: 			<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: 			<http://www.w3.org/2000/01/rdf-schema#> .
@prefix vann: 			<http://purl.org/vocab/vann/> .
@prefix xml: 			<http://www.w3.org/XML/1998/namespace> .
@prefix : 	    		<http://semweb.mmlab.be/ns/rml#> .
@base 		    		<http://semweb.mmlab.be/ns/rml#> .

###  http://semweb.mmlab.be/ns/rml#iterator

rml:iterator rdf:type owl:DatatypeProperty ;
    rdfs:label   "iterator" ;
    rdfs:comment "an expression qualified according to the reference formulation specified for pointing to an extract of the source data. "@en ;
    rdfs:domain  rml:LogicalSource;
    rdfs:range   xsd:string .


###  http://semweb.mmlab.be/ns/rml#reference

rml:reference rdf:type owl:DatatypeProperty ;
    rdfs:label   "reference" ;
    rdfs:comment "A valid expression that selects values from the source data. The reference should confront to the syntax rules/grammar of the specified Reference Formulation. "@en ;
    rdfs:domain  rr:TermMap;
    rdfs:range   xsd:string .


###  http://semweb.mmlab.be/ns/rml#version

rml:version rdf:type owl:DatatypeProperty ;
    rdfs:label   "version" ;
    rdfs:comment "It defines the version of the reference Formulation used. "@en ;
    rdfs:domain  rml:LogicalSource;
    rdfs:range   xsd:string .

###  http://semweb.mmlab.be/ns/rml#source

rml:source rdf:type rdf:Property ;
    rdfs:label   "source" ;
    rdfs:comment "qualified name of the source data."@en ;
    rdfs:domain  rml:LogicalSource .


###  http://mmlab.be/rml#query

rml:query rdf:type owl:DatatypeProperty ;
    rdfs:comment "A valid query."@en ;
    rdfs:domain  rml:LogicalSource .

The owl:DatatypeProperty instances without rdfs:range are not found, while range is optional in the query.

from graphql-ld.js.

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.