incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Story (JIRA)" <>
Subject [jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly
Date Thu, 12 May 2011 07:37:47 GMT


Henry Story commented on CLEREZZA-510:

I put it in 


because I am starting to need it in other packages, not just the test package.

Some issues I have thought of when building and using this (usage helps the most in understanding)

  1. It could be merged with SimpleGraphNode
      (but I thought it would be better to do that, when this class is well understood, as
I don't want to by accident make Simple complex)
  2. It coud be more efficient. EasyGraph could have lazy val references to instances of the
inner Predicate and InversePredicate classes
      which would have var references to the UriRefs that identify them, so that it does not
need to create a new object on every statement creation. This would restrict the writing of
such graph to a single threads
  3. one should look at using -- and --> perhaps for arrows, and so also <-- and --
for reverse arrows, as those are easier to type, and available on more platforms. On the other
hand one has to watch out about operator precedence rules. From the Scala Reference book
      The precedence of an infix operator is determined by the operator’s first character.
      Characters are listed below in increasing order of precedence, with characters on
      the same line having the same precedence.
              (all letters)
              < > 
              = !
             + *
             / %
           (all other special characters)

    That is, operators starting with a letter have lowest precedence, followed by operators
    starting with ‘|’, etc. 
    There’s one exception to this rule, which concerns assignment operators(§6.12.4).
    The precedence of an assigment operator is the same as the one of simple assignment
    (=). That is, it is lower than the precedence of any other operator.
    The associativity of an operator is determined by the operator’s last character. Operators
    ending in a colon ‘:’ are right-associative. All other operators are leftassociative.
    4. If one is to use unicode symbols, there may be more appropriate ones that I have not

> DSL for writing RDF elegantly
> -----------------------------
>                 Key: CLEREZZA-510
>                 URL:
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Henry Story
>            Assignee: Henry Story
>         Attachments: NiceLookingGraphInScala.png
> Writing RDF like 
> graph.add(new TripleImp(Subj,rel,obj))
> is tedious to read and to write and makes every thing seem really heavy. Make it look

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message