Skip to content

Proposed alternative syntax for Surface #5

Open
@pchampin

Description

@pchampin

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 ;)

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