marrus-sh / alrescha Goto Github PK
View Code? Open in Web Editor NEW♓️🌟 An ECMAScript library for walking RDF graphs.
License: Creative Commons Zero v1.0 Universal
♓️🌟 An ECMAScript library for walking RDF graphs.
License: Creative Commons Zero v1.0 Universal
.toTurtle()
should produce smaller output than .toNT()
.
(This is not a priority.)
Ideally, Al·rishāʼ would validate the .nominalValue
of a Literal
before converting it using [Symbol.toPrimitive]
or .valueOf()
. If the .nominalValue
is not in the lexical space for its .datatype
, the string value of the .nominalValue
should be returned instead. This would make it easy to check if a Literal
is valid, by testing the return type of these functions.
While it makes for simpler code to just do Array.from(s)
, if the same effect can be implemented just by iterating over s
, the conversion is unnecessary.
(Do this before closing the milestone.)
Al·rishāʼ needs to be able to output RDF/XML in a format that it is easy to design XSLT stylesheets for. This likely means passing in a list of preferred starting points, and walking the graph from those starting points until another starting point of higher precedence is reached, and then finally outputting any resources which have yet to be read. This can be facilitated by a Map which clones its keys from the Graph’s resource map and whose values are simply true/false about whether a resource has yet been output.
Drop support for Node imports (if applicable) and switch testing over to Deno’s builtin testing framework.
In actuality, NamedNodes should probably not be mandated to be actual IRIs, provided they follow the Turtle grammar (i.e., ([^#x00-#x20<>"{}|^`\] | UCHAR)*
). For property access, it would be nice to make this happen by Turtle name, i.e.:
thing["rdf:type"]
thing["<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"]
both resolve to the same value. This means that RDFNode.prototype[Symbol.toPrimitive]
should function like .toNT()
and not .toString()
(with .toString()
behaviour reserved only for Literal
s which are actually strings).
(The reason for this being that without the <
/>
, practically any string will return true for isIRI()
.)
Look, it’s probably unnecessary, but just to be safe.
Graph
should support the methods of RDF/JS Dataset
, or at the very least DatasetCore
.
Al·rishāʼ
should support the methods of RDF/JS DatasetFactory
, or at the very least DatasetCoreFactory
.
Instead of constantly revoking resources when they have zero entries, just allow resources to be empty, and create new ones on property access if none exists. So that one can go
graph = Al·rishāʼ.createGraph()
graph[`example:rsrc`][`example:p`] = `example value`
and have it work as expected. This should greatly simplify all code, and only has a cost for programs creating a large number of anonymous subjects and then deleting them all. A .prune()
function on Al·rishāʼ.Graph
to freeze and remove empty resources from the resource map might then be useful.
It is not necessary to iterate over every triple when it is easy to get just the triples with a given subject. And likewise for triples with a given predicate, given a subject.
This will give graph.match(s, p, null)
parity with graph[s][p]
instead of being much slower.
This should replace the .toDOMNode()
API if possible.
(Do this before closing the milestone.)
This should already be the case, but it should be explicitly checked before the v1d1 milestone is closed.
This needs to be a separate class which can be extended (or, ideally, subclassed) with additional getters. The ideal situation would be to have a .data
property on a Resource which automatically generates the right kind of ResourceData based on the properties of the node, but the infrastucture for this might be complex. Perhaps something like:
Al·rishāʼ.dataKinds.add(pname `example:type`, MyResourceData)
Al·rishāʼ.dataKinds.add(resource => resource.has(`example:p`), MyPResourceData)
These should return a Symbol which can then be used with Al·rishāʼ.dataKinds.remove()
to remove the data kind.
The initial properties/methods should be something like:
resource
textDescription
, createDescription(document)
textLabel
, createLabel(document)
, toString(document)
textValue
, createValue(document)
, valueOf(document)
The document
in the above methods is for values which are rdf:XMLLiteral
s or rdf:HTML
.
By which I mean those such as rdf:rest
which are used often and currently being constructed every single time. Now that these are immutable there is no reason not to just use the same object for all of them.
This is less of a priority than output, initially.
etc.
Since .matches()
now follows Graph
behaviour regarding null
, a similar .removeMatches()
function might be useful, e.g. to completely remove mention of a node from a graph.
There should not be any functions being declared inside of constructors, only bindings.
This should produce the minimal JSON for both RDF Interfaces and RDF/JS applications to understand. This is NOT JSON‐LD output.
This may require some complex string analysis and escaping.
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.