Skip to content

graph builtin ontologies #205

@bblfish

Description

@bblfish

@josd showed me the following code to translate n4 code (NQuads with prefixes and relative URLs to translate it to n3.

@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix graph: <http://www.w3.org/2000/10/swap/graph#>.
@prefix : <urn:example:>.

:a :b :c :g1.
:d :e :f :g1.
:g :h :i :g1.

:j :k :l :g2.

:e :f :g .

{
    ?S ?P ?O ?G.
    ({?A ?B ?C} {?A ?B ?C ?G} ?L) log:collectAllIn ?SCOPE.
    ?GT graph:list ?L.
} => {
    ?G :graphTerm ?GT.
}.

to run with

> eye --quiet --nope collect.n3 --pass-only-new
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix graph: <http://www.w3.org/2000/10/swap/graph#>.
@prefix : <urn:example:>.

<urn:example:g1> <urn:example:graphTerm> {
    <urn:example:a> <urn:example:b> <urn:example:c>.
    <urn:example:d> <urn:example:e> <urn:example:f>.
    <urn:example:g> <urn:example:h> <urn:example:i>.
}.
<urn:example:g2> <urn:example:graphTerm> {
    <urn:example:j> <urn:example:k> <urn:example:l>.
}.

So I looked for the documentation of the various pieces and found
Notation3 Builtin Functions but could not find graph and the namespace for graph returns a 404.

  1. The builtins should be linked to from the front page of this repo I think - quite useful
  2. should graph be part of the builtins? It is used twice in the repo (though mentioned quite a few more times)
find . -name "*.n3" -exec grep -q "graph:\w" {} \; -print
./tests/dogfood/run_reason_tests.n3
./tests/dogfood/run_parser_tests.n3
  1. the string:matches will be very useful for many access control use cases. I wonder how much the "perl/python" regex syntax matches or differs from the java/js style? or if libs are easily available for these... @philarcher was the specialist of this, having developed POWDER spec. He pointed me to some relevant documents yesterday... Mostly, they will have some good feedback on how compatible regexes are. I hope it is not too complicated...

I was wondering how I could get the above n3 to also publish a copy of the triples in the graph (not just the transformed quads)... So I can translate jsonld to n3 more easily from issue 204

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions