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

Proposed alternative syntax for Surface #5

Open
pchampin opened this issue Dec 15, 2022 · 3 comments
Open

Proposed alternative syntax for Surface #5

pchampin opened this issue Dec 15, 2022 · 3 comments

Comments

@pchampin
Copy link

What about something like that, where

  • { ... } is a positive surface
  • {! ... } is a negative surface
  • {? ... } is a query surface
  • {* ... } is a neutral surfac
  • {@:MySurfaceType ... } is a custom type surface
# every student is a person
{! _:x a :Student !{ _x: a Person }}.
# every cat is dead or alive (or both)
{! _x: a :Cat !{ _:x a :Alive } !{ _x a :Dead }}.

We also need a way to declare a bnode in a surface that is only used in triples from inner surfaces. We could enclose them in |, like:

# everyone knows Bob
{! |_:x| !{ _:x :knows :bob }}

NB: my first attempt was {! _:x | ... }, which looks like "x such that ...." in math notation, but that would be tricky to parse, especially if more than 3 variables are declared -- is it an invalid triple, or a list of declared variables?
The proposal above is visually similar, and also reminiscent of closures in Rust and Ruby ;)

@phochste
Copy link
Collaborator

That are great proposals for experiments. At this stage for us RDF Surfaces is a kind of assembly language for logic for us. Jos and I discussed today that transpilers could be imagined to translate your syntax into the current RDF Surfaces syntax to experiment with the look and feel and developer friendliness. A very literal translation would still require programmers to write programs in first-order logic.

@josd
Copy link
Collaborator

josd commented Dec 15, 2022

For me it is really nice to have it in N3 esp. for its built-ins and some surfaces are just built-ins.
It is also very nice to see a surface as, yes, just a triple so that we can reason over them and annotate them as RDF-star triples (like we already do for instance in https://github.com/eyereasoner/eye/blob/master/reasoning/blogic/socrates-star.n3).

@phochste
Copy link
Collaborator

Here is an example of a Lisp-like syntactic sugar along the lines that you suggested that can be added on top of RDF surfaces: N3L. The logical meaning of these programs stays the same and still is like programming in first-order logic. What should happen with the logic in a reasoner is the core question.

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

3 participants