Comments (12)
Your path is in fact correct, it's only the error message that incorrectly constructucts the path (this will be fixed soon in a Components.js rewrite).
What is the full error you are getting? That should show more information about what is going wrong.
Side-note, have you seen this? This is ported from code you wrote before.
from server.js.
Your path is in fact correct, it's only the error message that incorrectly constructucts the path (this will be fixed soon in a Components.js rewrite).
What is the full error you are getting? That should show more information about what is going wrong.
I get a second error indeed, which I thought was unrelated:
Error: Invalid components file "config.json":
Error: No valid parser was found, both N3 and JSON-LD failed:
[
Error: Expected entity but got literal on line 2.
...
jsonld.InvalidUrl: 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.
...
details:
{
code: 'loading remote context failed',
url: 'https://linkedsoftwaredependencies.org/bundles/npm/ldf-datasource-summary/^0.0.1/components/context.jsonld',
cause: [JsonLdError]
}
https://linkedsoftwaredependencies.org/bundles/npm/ldf-datasource-summary/0.0.1/components/context.jsonld returns a 500, but regardless, I thought Components.js checks the local filesystem first?
Side-note, have you seen this? This is ported from code you wrote before.
Jep! But that's a different thing, ie. publishing the summaries. This module is to use summaries as a datasource, more of a niche application.
from server.js.
I thought Components.js checks the local filesystem first?
Indeed, it should.
Your package.json, config file and components files look fine to me, so perhaps something is going wrong when starting the server.
I suspect your config is being loaded, but your ldf-datasource-summary
was not detected by Components.js.
This could be because it is not part of the node_modules
folder the main module path (usually location of the server package).
If you are using @ldf/server
, then you'll have to add ldf-datasource-summary
to its dependencies (npm link
should be fine as well).
A better approach would be to fork @ldf/server
into a dedicated npm package that you can optionally re-publish, and add the dependency there.
from server.js.
FYI, we just discovered that npx
may also be a good tool for this: LinkedSoftwareDependencies/Components.js#29 (comment)
from server.js.
Thanks @rubensworks. The issue persists, even with npm link (or npx)... could you explain what you mean with fork? I have my own 'copy' of @ldf/server where I edited the package.json and config.json.
I've put the files here, maybe you can reproduce?
from server.js.
I may be missing something, but the server seems to be starting without issues for me when using your repos.
My steps:
- Clone and install the two repos
- Npm link
ldf-datasource-summary
intosummary-server
. - Execute
node bin/ldf-server config/config-example.json
with the following config contents (original one does not seem to include the summary datasource):
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@ldf/server/^3.0.0/components/context.jsonld",
"@id": "urn:ldf-server:my",
"import": "preset-qpf:config-defaults.json",
"title": "My Linked Data Fragments server",
"datasources": [
{
"@id": "ex:myHdtDatasource",
"@type": "HdtDatasource",
"datasourceTitle": "DBpedia 2014",
"description": "DBpedia 2014 with an HDT back-end",
"datasourcePath": "dbpedia",
"hdtFile": "data/dbpedia2014.hdt"
},
{
"@id": "ex:mySparqlDatasource",
"@type": "SparqlDatasource",
"datasourceTitle": "DBpedia (Virtuoso)",
"description": "DBpedia with a Virtuoso back-end",
"datasourcePath": "dbpedia-sparql",
"sparqlEndpoint": "https://dbpedia.org/sparql"
},
{
"@id": "ex:register",
"@type": "SummaryDatasource",
"datasourceTitle": "Summary register for source selection",
"description": "My dataset with a Summaries back-end",
"datasourcePath": "summary",
"dir": "/received-summaries"
}
]
}
from server.js.
@mielvds FYI, I've justed updated the server (3.2.0) to Components.js v4, which may simplify things on your end.
Configs are fully backwards-compatible.
from server.js.
Thx @rubensworks , the error messages are much clearer now for debugging. I have update both repos. Can't get it to work though and i have no idea why it works for you.
Right now, I get:
2021-01-20T15:18:09.309Z [Components.js] warn: Detected remote context lookup for 'https://linkedsoftwaredependencies.org/bundles/npm/ldf-datasource-summary/^0.0.1/components/context.jsonld' in /Users/mielvandersande/Meemoo/NDE/demo/datasource-summary/components/components.jsonld. This may indicate a missing or invalid dependency, or an invalid context URL.
If I replace the link in ldf-datasource-summary/components/components.jsonld
directly with the context
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld",
{
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
"ldfdsm": "npmd:ldf-datasource-summary/",
"files-ldfdsm": "ldfdsm:^0.0.1/",
"SummaryDatasource": "ldfdsm:Datasource/Summary"
}
],
"@id": "npmd:ldf-datasource-summary",
"@type": "Module",
"requireName": "ldf-datasource-summary",
"import": [
"files-ldfdsm:components/Datasource/Summary.jsonld"
]
}
I get Component definition error: Error: Error while parsing file "https://linkedsoftwaredependencies.org/bundles/npm/ldf-datasource-summary/^0.0.1/components/Datasource/Summary.jsonld": Unexpected "T" at position 0 in state STOP
Here I'm completely lost I'm afraid :)
from server.js.
This might be due to the usage of "lsd:module": true
, which expands to a context URL that only includes the major version of your package (in your case ^0.0.0
).
Could you try applying the following change in your components file?
- "files-ldfdsm": "ldfdsm:^0.0.1/",
+ "files-ldfdsm": "ldfdsm:^0.0.0/",
I can have another look at it tomorrow if things would still not work after this.
from server.js.
yes, that did it! Almost there ;)
Now it just needs to pick up the parameters:
Component definition error:
Error: Error while parsing file "config.json": Invalid predicate IRI: dir
With config.json:
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@ldf/server/^3.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/summary-server/^0.0.0/components/context.jsonld"],
"@id": "urn:ldf-server:my",
"import": "preset-qpf:config-defaults.json",
"title": "My Linked Data Fragments server",
"datasources": [
{
"@id": "ex:register",
"@type": "SummaryDatasource",
"datasourceTitle": "Summary register for source selection",
"description": "My dataset with a Summaries back-end",
"datasourcePath": "summary",
"dir": "/received-summaries"
}
]
}
from server.js.
dir
should probably be ldfdsm:Datasource/Summary#dir
(unless you add an entry for it in your context).
from server.js.
ah yes, now I understand and it works. I wrongfully thought
"constructorArguments": {
"@id": "ldfdsm:Datasource/Summary#constructorArgumentsObject",
"extends": "ldfc:Datasource#constructorArgumentsObject",
"fields": [
{
"keyRaw": "dir",
"value": "ldfdsm:Datasource/Summary#dir"
}
]
}
was taking care of that.
Thx @rubensworks !
from server.js.
Related Issues (20)
- Error: Cannot find module 'rdf-string' in core package HOT 2
- TypeError: Cannot set property graph of #<Quad> which has only a getter HOT 2
- Dependency Dashboard
- No matches in readme data example HOT 4
- how to setup a local fuseki server ? HOT 5
- Only first page is returned when using proxy HOT 2
- Composite data source is empty in 3.x (worked in 2.x) HOT 2
- Wikidata SPARQL endpoint not working HOT 7
- Shouldn't it be SPARQL Endpoint instead of HDT file? HOT 1
- Is it possible to add the server as a dependency of another server? HOT 1
- Invalid filename for HDT source HOT 2
- Consistently use file to refer to file paths (and not e.g. htdFile).
- Replace Request dependency HOT 3
- Does the server support searching/filtering by string literals' language tags? HOT 1
- `void:triples` has page as subject instead of dataset. HOT 1
- SIGTERM no longer reloads data properly - just adds more workers HOT 2
- Uncontrolled Resource Consumption in parse-link-header HOT 3
- Server-Side Request Forgery in Request
- Checking WAC permissions with LDF ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from server.js.