tpluscode / rdf-string Goto Github PK
View Code? Open in Web Editor NEWSimplifies creating of RDF strings
Home Page: https://tpluscode.github.io/rdf-string/
Simplifies creating of RDF strings
Home Page: https://tpluscode.github.io/rdf-string/
import { turtle } from '@tpluscode/rdf-string'
turtle`${dataset}`.toString({
ordered: true,
})
The example is turtle, but should apply also to other formats ordering by graph (where applicable), subject, predicate, object
I get errors when trying to use the library in typescript module with moduleResolution node16
or nodeNext
.
e.g.
Could not find a declaration file for module '@tpluscode/rdf-string'. '/workspaces/my-project/node_modules/@tpluscode/rdf-string/index.mjs' implicitly has an 'any' type.
There are types at '/workspaces/my-project/node_modules/@tpluscode/rdf-string/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@tpluscode/rdf-string' library may need to update its package.json or typings.
import { turtle } from '@tpluscode/rdf-string'
turtle`${dataset}`.toString({
prefixes: {
dbr: 'http://dbpedia.org/resource/',
}
})
I'm getting the following error because type declarations use NamedNode
with a type parameter.
node_modules/@tpluscode/rdf-string/lib/nquads.d.ts:18:132 - error TS2315: Type 'NamedNode' is not generic.
18 export declare const nquads: (strings: TemplateStringsArray, ...values: Value<TemplateResult<NQuadsOptions>, BlankNode | Literal |
NamedNode<string>>[]) => TemplateResult<NQuadsOptions>;
The .d.ts
files get generated like that despite the fact that the ts code contains no such argument. It seems to be a bug in typescript that is solved by updating typescript.
I double checked that my project has no older dependency than the ones in rdf-string
but I'm still getting the following error:
C:\Users\me\Documents\retog\rdfjs-dataset-sparql\node_modules\@tpluscode\rdf-ns-builders\vocabularies\as.js:1
TypeError: namespace is not a function
at Object.<anonymous> (node_modules/@tpluscode/rdf-ns-builders/vocabularies/as.js:2:19)
at Object.<anonymous> (C:\Users\me\Documents\retog\rdfjs-dataset-sparql\node_modules\@tpluscode\rdf-ns-builders\index.js:1)
Any idea what could be causing this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.