Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph builtin ontologies #205

Open
bblfish opened this issue Aug 22, 2023 · 1 comment
Open

graph builtin ontologies #205

bblfish opened this issue Aug 22, 2023 · 1 comment

Comments

@bblfish
Copy link

bblfish commented Aug 22, 2023

@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

@josd
Copy link
Collaborator

josd commented Aug 22, 2023

Stay tuned and for the moment you can see examples of graph: built-ins
Notation3-By-Example is the great work of @phochste 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants