awwright / node-rdf Goto Github PK
View Code? Open in Web Editor NEWECMAScript libraries for handling RDF data (based off of the current RDF APIs and webr3's js3)
License: The Unlicense
ECMAScript libraries for handling RDF data (based off of the current RDF APIs and webr3's js3)
License: The Unlicense
How can I export a Graph as n3 or NT?
Hello,
I would like to know if exists some function to print the profile,
I want to reconstruct the complete turtle file based on a graph I know how to print the triples
and create a string variable, but I don't find the way to print in the top of the file the prefix.
Say I've got a graph that refers to a blank node object "b1". How do I query for triples where "b1" is the subject?
<#me>
a foaf:Person;
cert:key [ # the object here is blank node "b1"
a cert:RSAPublicKey; # these are the triples I want to find
cert:exponent 65537;
cert:modulus "..."
].
The closest I can seem to get is graph.match("_:b1", null, null)
, which at least recognizes that I'm looking for a blank node, but throws with "unexpected BlankNode syntax". I can also find triples related to the predicate with graph.match(null, "cert:exponent", null)
, but that still requires that I manually filter for the subject I'm looking for.
Hi,
I try to use the "Builtins" feature of node-rdf to make the resulting code more readable, but I cannot create a triple by simply calling rdfEnvironment.createTriple(string, string, string)
-- this triggers an error because the Triple constructor checks the type of the arguments (cf. RDFNode.js:29ff). Is this intended? Am I using the "Builtins" feature wrong? Or should this be possible? Is there another way how I can create a triple with the "Builtins" feature?
Kind regards,
Chris
if namespace uri's are overlapping, like in the example below, PrefixMap.shrink sometime returns incorrect results, depending on the order of namespace declarations, e.g.
@Prefix xmp: http://ns.adobe.com/xap/1.0/ .
@Prefix xmpMM: http://ns.adobe.com/xap/1.0/mm/ .
@Prefix xmpRights: http://ns.adobe.com/xap/1.0/rights/ .
turtleParser.environment.prefixes.shrink('http://ns.adobe.com/xap/1.0/mm/DocumentID') -> 'xmp:mm/DocumentID' instead of 'xmpMM:DocumentID'
Turtle files with datatypes written with prefixes, eg: "1"^^xsd:number are not expanded to "http://www.w3.org/2001/XMLSchema#number" when parsing.
let graph = env.createGraph();
let turtleParser = new rdf.TurtleParser();
turtleParser.parse(rdfText, function () {
graph.forEach(triple => {
console.log(triple.object.datatype);
})
}, "", null, graph);
@prefix sh: <http://www.w3.org/ns/shacl#>.
@prefix : <http://example.com/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
:person1 :age "1"^^xsd:number .
:person1 a :Person.
xsd:number
Hi,
I've installed node-rdf via npm and encountered that the latest release there does not implement graph.removeMatches yet .. Could you release the latest commit as version to npm? Thanks.
Kind regards,
Chris
TripletGraph seems to have disappeared when I install from npm. Roughly:
$ npm install rdf
$ node
> rdf = require('rdf')
> rdf.TripletGraph
undefined
Hello there I was trying to find the package.json, but I could not find it! Is it on github?
is there a way to create docstrings ( i.e. literals with triple quotes) when using built-in mode?
I would like to have string.l()
which returns """ value """
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.