GithubHelp home page GithubHelp logo

elsevierlabs-os / linked-data Goto Github PK

View Code? Open in Web Editor NEW
28.0 7.0 3.0 3.75 MB

Linked Data Extension for VSCode

Home Page: https://marketplace.visualstudio.com/items?itemName=Elsevier.linked-data

License: Other

TypeScript 65.08% CSS 0.88% JavaScript 34.04%
code education json-ld linked-data nquads query rdf rdfxml shacl sparql

linked-data's People

Contributors

jeswr avatar rinkehoekstra 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

linked-data's Issues

feature: syntax highlight `.acl` files

Thanks for this great tool!

In the context of solid we often have RDF serialized .acl files. Specifically they usually serialised in turtle. Could this extension add support to apply syntax highlighting to those files by default if there is no other syntax highlighting already applied to .acl by other extensions.

Turtle output lying about isLogic

{
     "@context": {"@vocab": "http://schema.org/"},
     "@graph": [
         {
             "@type":"schema:Thing",
             "@id":"https://data.example.com/thing/1",
             "isLogic-as-Boolean": true,
             "isLogic-as-String" : "YES"        
         }
     ]
 }

when transformed to Turtle gives

@prefix schema: <http://schema.org/>.
@prefix thing: <https://data.example.com/thing/>.

thing:1
    a <schema:Thing>;
    schema:isLogic-as-Boolean false;
    schema:isLogic-as-String "YES".

Note that true is now false which is not logical.

Conversion to N-quads gives

<https://data.example.com/thing/1> <http://schema.org/isLogic-as-Boolean> "true"^^<http://www.w3.org/2001/XMLSchema#boolean>  .
<https://data.example.com/thing/1> <http://schema.org/isLogic-as-String> "YES"  .
<https://data.example.com/thing/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <schema:Thing>  .

Here the true is recognized as a true Boolelan, which is logical.

Other serialisations (compact, flatten, expanded) behave logical, from the true perspective at least.

Queries not handling sparse data well

Hello

I have noticed that when using a TTL to query with optional where clauses, the output doesn't allow for blank values and therefore shifts the populated values of one column into the unpopulated value.

For example, if I run the below query:

# file: example_file.ttl

prefix ex: <http://www.example.com>

select ?Name ?City ?PhoneNumber ?DateOfBirth
where {
?Name ex:LivesIn ?City.
?Name ex:BornOn ?DateOfBirth.
optional {?Name ex:HasPhoneNumber ?PhoneNumber.}
}

And my data has incomplete phone numbers and hence is being queried as an optional data point, I am seeing something like the below returned:

Name City PhoneNumber DateOfBirth
Fred London 1996-01-02
Dave Manchester +44123456789 1985-12-13
Sarah Cardiff 1992-10-30

The lack of phone number for Fred and Sarah sees their dates of birth slip into the phone number column.

I would expect it to look like the below:

Name City PhoneNumber DateOfBirth
Fred London 1996-01-02
Dave Manchester +44123456789 1985-12-13
Sarah Cardiff 1992-10-30

This appears on both the CSV output and the HTML view.

BUG: Fetching remote context not working

Remote "@context" is not properly supported, i.e. https not recognized.

How to reproduce

Create a file with content:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "actor": "https://other_domain/users/phoenix",
  "id": "https://other_domain/users/phoenix#likes/557",
  "object": "https://my_domain/activitypub/helge/id567",
  "type": "Like"
}

run Linked-Data: Compact

Error messages:

file:///home/helge/code/bovine/tests/data/https%3A/www.w3.org/ns/activitystreams. Detail: Unable to read file '/home/helge/code/bovine/tests/data/https:/www.w3.org/ns/activitystreams' (Error: Unable to resolve nonexistent file '/home/helge/code/bovine/tests/data/https:/www.w3.org/ns/activitystreams')

and

Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.

SPARQL results table visualization omits optional results

Given

@prefix ex: <http://example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:alice
  ex:name "Alice" ;
  ex:age "25"^^xsd:integer .

ex:bob 
  ex:name "Bob" ;
  ex:age "25"^^xsd:integer .

ex:charlie
  ex:name "Charlie" ;
  ex:age "25"^^xsd:integer .

ex:dave
  ex:name "Dave" ;
  ex:age "25"^^xsd:integer .

running the following query

PREFIX ex: <http://example.org/>

select ?name ?age
where {
  ?person ex:name ?name .
  OPTIONAL{?person ex:age ?age.}
}

gives the following expected result

image

But executing the same query on this input:

@prefix ex: <http://example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:alice
  ex:name "Alice" .
  # ex:age "25"^^xsd:integer .

ex:bob 
  ex:name "Bob" ;
  ex:age "25"^^xsd:integer .

ex:charlie
  ex:name "Charlie" ;
  ex:age "25"^^xsd:integer .

ex:dave
  ex:name "Dave" ;
  ex:age "25"^^xsd:integer .

give this result:

image

with this data result:

"Alice"
"Bob";"25"
"Charlie";"25"
"Dave";"25"

Shapes attribute is not considered when running `Validate`

Linked Data Extension v1.0.6
VSCode/Windows Version:
image

I am using your example for SHACL validation by placing the shapes attribute as a comment with the relative path to the shapes file:

# shapes: shacl_example_shapes.ttl
@prefix ex: <https://example.com/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:Alice
	a ex:Person ;
	ex:ssn "987-65-432A" .

However, still a dialog opens asking me to select the shapes file.

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.