Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Empty langString causes ["Invalid URL: value"] error #135

Open
Yucukof opened this issue Jun 10, 2022 · 0 comments
Open

Bug: Empty langString causes ["Invalid URL: value"] error #135

Yucukof opened this issue Jun 10, 2022 · 0 comments

Comments

@Yucukof
Copy link

Yucukof commented Jun 10, 2022

(This is consequent to this change in shex-codegen)

Whenever a TTL file contains a rdfs:langString with an empty character sequence, such as the following

@prefix : <http://www.w3.org/ns/shapetrees#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

:describesInstance
  a owl:ObjectProperty ;
  rdfs:domain :Description ;
  rdfs:comment ""@en ; // <- empty string
  rdfs:isDefinedBy <> ;
  rdfs:label "Describes Instance"@en .

then, the following error is thrown

    TypeError: Invalid URL: value
        at new URLImpl (/home/hba/Documents/Git/SOLID/src/node_modules/whatwg-url/dist/URL-impl.js:21:13)
        at Object.exports.setup (/home/hba/Documents/Git/SOLID/src/node_modules/whatwg-url/dist/URL.js:54:12)
        at new URL (/home/hba/Documents/Git/SOLID/src/node_modules/whatwg-url/dist/URL.js:107:22)
        at normalizeUrl (/home/hba/Documents/Git/shex-methods/lib/transform/rdfToData.js:86:23)
        at getNormalizedKeyFromContextOrSchemaPrefixes (/home/hba/Documents/Git/shex-methods/lib/transform/rdfToData.js:74:38)
        at /home/hba/Documents/Git/shex-methods/lib/transform/rdfToData.js:38:28
        at Array.map (<anonymous>)
        at absoluteToNormalized (/home/hba/Documents/Git/shex-methods/lib/transform/rdfToData.js:34:51)
        at /home/hba/Documents/Git/shex-methods/lib/transform/rdfToData.js:48:35
        at Array.map (<anonymous>)

      at ../../shex-methods/lib/validate.js:65:17

I have not been able to track the exact source of the issue, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant