You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@clerezza.apache.org by "Henry Story (JIRA)" <ji...@apache.org> on 2011/05/07 19:48:03 UTC

[jira] [Created] (CLEREZZA-510) DSL for writing RDF elegantly

DSL for writing RDF elegantly
-----------------------------

                 Key: CLEREZZA-510
                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
             Project: Clerezza
          Issue Type: New Feature
            Reporter: Henry Story


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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by Reto Bachmann-Gmuer <re...@apache.org>.
I must admit that I'm a bit skeptical about the trying out a new testsuite
part. I think its really crucial to get this issue closed asap as many
issues depend on it. There are various testsuites that exploit scala better
than junit, yet the test as with my skeleton are easily implemented and when
others look at them they quickly understand what 's going on. So I suggest
you postpone introducing a new testsuite.

Have a nice journey back to paris,
Reto
On Jun 14, 2011 8:01 PM, "Henry Story (JIRA)" <ji...@apache.org> wrote:
>
> [
https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049312#comment-13049312]
>
> Henry Story commented on CLEREZZA-510:
> --------------------------------------
>
> I'll be flying to Paris tomorrow, so I can add test suites, and clean up
this code therafter. Found a great new scala testing library, so I'll want
to try this out...
>
>> DSL for writing RDF elegantly
>> -----------------------------
>>
>> Key: CLEREZZA-510
>> URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>> 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 good.
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>

Re: [jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by Reto Bachmann-Gmür <re...@trialox.org>.
Looking at our code writing goes generally together with reading. The existing code is focused on reading because scala was firts used fo ssp and thus only required read access, adding methods like ++ to collectediter should be straight forward.

Cheers 
reto


----- Original message -----
> 
>         [
> https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030407#comment-13030407
> ] 
> 
> Henry Story commented on CLEREZZA-510:
> --------------------------------------
> 
> I think it is worth creating a more write oriented version first, see
> how that works and the fuse them if needed, or map one to the other. 
> 
> > DSL for writing RDF elegantly
> > -----------------------------
> > 
> > Key: CLEREZZA-510
> > URL: https://issues.apache.org/jira/browse/CLEREZZA-510
> > Project: Clerezza
> > Issue Type: New Feature
> > Reporter: Henry Story
> > 
> > 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 good.
> 
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Issue Comment Edited] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057854#comment-13057854 ] 

Henry Story edited comment on CLEREZZA-510 at 6/30/11 2:46 PM:
---------------------------------------------------------------

The Ascii Arrow notation is now the default.

That is it is now possible to write rdf statements when needed in Scala code in a way that is easy for humans to read and write, as it removes a lot of duplication.
For examples see the Test Suite. 

(sorry for edits, it does not look good in jira. There is no easy link from the editing page to any markup notation)

      was (Author: bblfish):
    The Ascii Arrow notation is now the default.

That is it is now possible to write rdf statements when needed in Scala code in a way that is easy for humans to read and write, as it removes a lot of duplication.
Here is an example from the Test Suite. (For Unicode and english language styles examples see there too.)

<code>
		 val ez = EzGraph()
		 // example using arrows
		 (
		   ez.b_("reto").a(FOAF.Person)
			 -- FOAF.name --> "Reto Bachman-Gmür".lang(rm)
			 -- FOAF.title --> "Mr"
			 -- FOAF.currentProject --> "http://clerezza.org/".uri
			 -- FOAF.knows --> (
			     ez.u("http://bblfish.net/#hjs").a(FOAF.Person)
			          -- FOAF.name --> "Henry Story"
			          -- FOAF.currentProject --> "http://webid.info/".uri
 			          -<- identity -- (
			                   ez.bnode.a(RSAPublicKey) //. notation because of precedence of operators
			                       -- modulus --> 65537
			                       -- public_exponent --> (bblfishModulus^^hex) // brackets needed due to precedence
			                   )
			          -- FOAF.knows -->> List(ez.b_("reto").ref,ez.b_("danny").ref)
			 )
			 -- FOAF.knows --> (ez.b_("danny").a(FOAF.Person)
			                                       -- FOAF.name --> "Danny Ayers".lang(en)
		                                               -- FOAF.knows --> "http://bblfish.net/#hjs".uri //knows
					                       -- FOAF.knows --> ez.b_("reto")
			                              )
		 )
</code>
  
> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Story updated CLEREZZA-510:
---------------------------------

    Attachment: NiceLookingGraphInScala.png

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057802#comment-13057802 ] 

Henry Story edited comment on CLEREZZA-510 at 6/30/11 1:02 PM:
---------------------------------------------------------------

So with recent changes we now have

- all public members are documented
- a full junit test suite has been added, that tests many aspects of these classes, and was used in refactoring them
- separation of the different styles of writing code, so that unicode, ascii or just plain english can be used separately. This makes it easier to recognise how methods fit together when using a IDE.
  This will allows for real user feedback on which of these ways people prefer.  Probably the Ascii arrows should be made the default.
- EzGraph (ex EasyGraph) now now longer extends SimpleMGraph, but wraps a TripleCollection 
- RichGraphNode extends GraphNode which is a read only TripleCollection, to turn it into a mutable graph would be a dramatic API change. I think there is a good reason for separating reading and writing of graphs. Most RichGraphNodes are used in SSPs where no writing should be done, so that offering that functionality could easily be misleading. Now to build immutable but evolvable GraphNodes would be an interesting project, but perhaps not right for this issue.



      was (Author: bblfish):
    So with recent changes we now have

- all public members are documented
- separation of the different styles of writing code, so that unicode, ascii or just plain english can be used separately. This makes it easier to recognise how methods fit together when using a IDE.
  This will allows for real user feedback on which of these ways people prefer.  Probably the Ascii arrows should be made the default.
- EzGraph (ex EasyGraph) now now longer extends SimpleMGraph, but wraps a TripleCollection 
- RichGraphNode extends GraphNode which is a read only TripleCollection, to turn it into a mutable graph would be a dramatic API change. I think there is a good reason for separating reading and writing of graphs. Most RichGraphNodes are used in SSPs where no writing should be done, so that offering that functionality could easily be misleading. Now to build immutable but evolvable GraphNodes would be an interesting project, but perhaps not right for this issue.


  
> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042029#comment-13042029 ] 

Reto Bachmann-Gmür edited comment on CLEREZZA-510 at 6/1/11 2:16 PM:
---------------------------------------------------------------------

For the issue to be resolvable:
- It should be at least minimally documented, a minimal documentation includes api documentation for all public members.
- not use unicode character not readily available in the most commonly used  fonts on all major operating systems.
- EasyGraph should not extend SimpleMGraph, the current implementations copies all the triples of the wrapped graph in memory
- As I already commented on May 8, as writing generally goes together with reading I don't see why we should have a RichGraphNode for reading and EasyGraphNode for writing 

      was (Author: reto):
    For the issue to be resolvable:
- It should be at least minimally documented, a minimal documentation includes api documentation for all public members.
- not use unicode character not readily available in the most commonly used  fonts on all major operating systems.
- EasyGraph should extend SimpleMGraph, the current implementations copies all the triples of the wrapped graph in memory
- As I already commented on May 8, as writing generally goes together with reading I don't see why we should have a RichGraphNode for reading and EasyGraphNode for writing 
  
> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030482#comment-13030482 ] 

Reto Bachmann-Gmür commented on CLEREZZA-510:
---------------------------------------------

Looking at our code writing goes generally together with reading. The existing code is focused on reading because scala was firts used fo ssp and thus only required read access, adding methods like ++ to collectediter should be straight forward.

Cheers 
reto


----- Original message -----



> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Henry Story
>
> 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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür closed CLEREZZA-510.
---------------------------------------

    Resolution: Fixed

Many creative enhancements deferred such as to CLEREZZA-593. Closing this issue allows keeping the WebId Testsuite in the release (which had a undeclared dependency on this issue).

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057854#comment-13057854 ] 

Henry Story commented on CLEREZZA-510:
--------------------------------------

The Ascii Arrow notation is now the default.

That is it is now possible to write rdf statements when needed in Scala code in a way that is easy for humans to read and write, as it removes a lot of duplication.
Here is an example from the Test Suite. (For Unicode and english language styles examples see there too.)

		 val ez = EzGraph()
		 // example using arrows
		 (
		   ez.b_("reto").a(FOAF.Person)
			 -- FOAF.name --> "Reto Bachman-Gmür".lang(rm)
			 -- FOAF.title --> "Mr"
			 -- FOAF.currentProject --> "http://clerezza.org/".uri
			 -- FOAF.knows --> (
			     ez.u("http://bblfish.net/#hjs").a(FOAF.Person)
			          -- FOAF.name --> "Henry Story"
			          -- FOAF.currentProject --> "http://webid.info/".uri
 			          -<- identity -- (
			                   ez.bnode.a(RSAPublicKey) //. notation because of precedence of operators
			                       -- modulus --> 65537
			                       -- public_exponent --> (bblfishModulus^^hex) // brackets needed due to precedence
			                   )
			          -- FOAF.knows -->> List(ez.b_("reto").ref,ez.b_("danny").ref)
			 )
			 -- FOAF.knows --> (ez.b_("danny").a(FOAF.Person)
			                                       -- FOAF.name --> "Danny Ayers".lang(en)
		                                               -- FOAF.knows --> "http://bblfish.net/#hjs".uri //knows
					                       -- FOAF.knows --> ez.b_("reto")
			                              )
		 )

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Resolved] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Story resolved CLEREZZA-510.
----------------------------------

    Resolution: Fixed

please let us know what changes are needed to this, so that this can be closed

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057802#comment-13057802 ] 

Henry Story commented on CLEREZZA-510:
--------------------------------------

So with recent changes we now have

- all public members are documented
- separation of the different styles of writing code, so that unicode, ascii or just plain english can be used separately. This makes it easier to recognise how methods fit together when using a IDE.
  This will allows for real user feedback on which of these ways people prefer.  Probably the Ascii arrows should be made the default.
- EzGraph (ex EasyGraph) now now longer extends SimpleMGraph, but wraps a TripleCollection 
- RichGraphNode extends GraphNode which is a read only TripleCollection, to turn it into a mutable graph would be a dramatic API change. I think there is a good reason for separating reading and writing of graphs. Most RichGraphNodes are used in SSPs where no writing should be done, so that offering that functionality could easily be misleading. Now to build immutable but evolvable GraphNodes would be an interesting project, but perhaps not right for this issue.



> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030408#comment-13030408 ] 

Henry Story commented on CLEREZZA-510:
--------------------------------------

but yes, this is Scala specific. For java my som(m)er project is probably the best one can do - though because dev.java.net has been moved the documentation for that is no longer visible.

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Henry Story
>
> 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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049312#comment-13049312 ] 

Henry Story commented on CLEREZZA-510:
--------------------------------------

I'll be flying to Paris tomorrow, so I can add test suites, and clean up this code therafter. Found a great new scala testing library, so I'll want to try this out...

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030407#comment-13030407 ] 

Henry Story commented on CLEREZZA-510:
--------------------------------------

I think it is worth creating a more write oriented version first, see how that works and the fuse them if needed, or map one to the other. 

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Henry Story
>
> 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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057889#comment-13057889 ] 

Henry Story commented on CLEREZZA-510:
--------------------------------------

ah yes it is writeable. Initially I did not want to touch RichGraphNode because I did not know where this was going to lead me, and if it was even possible to do this, or useful. So there we got EzGraphNode, which is nice and stable now, well documented and has the huge advantage of having the Z of Clerezza in the second position of the name!

So as a compromise solution that is easy to implement, I propose (and checked in) that EzGraphNode extends RichGraphNode. Then all is well, the release is ready to go, and little needs changing.




> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032288#comment-13032288 ] 

Henry Story commented on CLEREZZA-510:
--------------------------------------

I put it in 

   ./rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala

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
      though.
  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
    <blockquote>
      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.
</blockquote>
    
    4. If one is to use unicode symbols, there may be more appropriate ones that I have not noticed.
  

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030380#comment-13030380 ] 

Reto Bachmann-Gmür commented on CLEREZZA-510:
---------------------------------------------

Is this both about java and scala? Fo what scala is concerned I think the existing DSL for resource oriented access (RichGraphNode and CollectedIter) should be extended.

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Henry Story
>
> 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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057874#comment-13057874 ] 

Reto Bachmann-Gmür commented on CLEREZZA-510:
---------------------------------------------

you write
"- RichGraphNode extends GraphNode which is a read only TripleCollection, to turn it into a mutable graph would be a dramatic API change. I think there is a good reason for separating reading and writing of graphs. Most RichGraphNodes are used in SSPs where no writing should be done, so that offering that functionality could easily be misleading. Now to build immutable but evolvable GraphNodes would be an interesting project, but perhaps not right for this issue. "

RichGraphNode allows modification of the Triple Coolection (adding and removing properties), you currently just need to use the inherited method from GraphNode (which is neither a TripleCollection nor read-only). The idea behind RichGraphNode and GraphNode was to be a Resource-Wrapper usable both on top of mutable as well as immutable triple collections (i.e. Graphs and MGraphs). RichGraphNode had less DSL style methods for graph-anging operations, adding those would imho be the scope of this issue.

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Reopened] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür reopened CLEREZZA-510:
-----------------------------------------


For the issue to be resolvable:
- It should be at least minimally documented, a minimal documentation includes api documentation for all public members.
- not use unicode character not readily available in the most commonly used  fonts on all major operating systems.
- EasyGraph should extend SimpleMGraph, the current implementations copies all the triples of the wrapped graph in memory
- As I already commented on May 8, as writing generally goes together with reading I don't see why we should have a RichGraphNode for reading and EasyGraphNode for writing 

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035500#comment-13035500 ] 

Reto Bachmann-Gmür commented on CLEREZZA-510:
---------------------------------------------

I've seen that easygraph is already used in code in trunk (accountrcontrolpanel), this shouldn't be. Please wait for the issue to be closed before actually using its functionality elsewhere, otherwise changes become tedious.

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Story reassigned CLEREZZA-510:
------------------------------------

    Assignee: Henry Story

> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             Project: Clerezza
>          Issue Type: New Feature
>            Reporter: Henry Story
>            Assignee: Henry Story
>
> 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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032288#comment-13032288 ] 

Henry Story edited comment on CLEREZZA-510 at 5/12/11 7:42 AM:
---------------------------------------------------------------

I put it in 

   ./rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala

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
      though.
  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
    <blockquote>
      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.
</blockquote>
    
    4. If one is to use unicode symbols, there may be more appropriate ones that I have not noticed.
  

      was (Author: bblfish):
    I put it in 

   ./rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala

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
      though.
  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
    <blockquote>
      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.
</blockquote>
    
    4. If one is to use unicode symbols, there may be more appropriate ones that I have not noticed.
  
  
> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (CLEREZZA-510) DSL for writing RDF elegantly

Posted by "Henry Story (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057854#comment-13057854 ] 

Henry Story edited comment on CLEREZZA-510 at 6/30/11 2:44 PM:
---------------------------------------------------------------

The Ascii Arrow notation is now the default.

That is it is now possible to write rdf statements when needed in Scala code in a way that is easy for humans to read and write, as it removes a lot of duplication.
Here is an example from the Test Suite. (For Unicode and english language styles examples see there too.)

<code>
		 val ez = EzGraph()
		 // example using arrows
		 (
		   ez.b_("reto").a(FOAF.Person)
			 -- FOAF.name --> "Reto Bachman-Gmür".lang(rm)
			 -- FOAF.title --> "Mr"
			 -- FOAF.currentProject --> "http://clerezza.org/".uri
			 -- FOAF.knows --> (
			     ez.u("http://bblfish.net/#hjs").a(FOAF.Person)
			          -- FOAF.name --> "Henry Story"
			          -- FOAF.currentProject --> "http://webid.info/".uri
 			          -<- identity -- (
			                   ez.bnode.a(RSAPublicKey) //. notation because of precedence of operators
			                       -- modulus --> 65537
			                       -- public_exponent --> (bblfishModulus^^hex) // brackets needed due to precedence
			                   )
			          -- FOAF.knows -->> List(ez.b_("reto").ref,ez.b_("danny").ref)
			 )
			 -- FOAF.knows --> (ez.b_("danny").a(FOAF.Person)
			                                       -- FOAF.name --> "Danny Ayers".lang(en)
		                                               -- FOAF.knows --> "http://bblfish.net/#hjs".uri //knows
					                       -- FOAF.knows --> ez.b_("reto")
			                              )
		 )
</code>

      was (Author: bblfish):
    The Ascii Arrow notation is now the default.

That is it is now possible to write rdf statements when needed in Scala code in a way that is easy for humans to read and write, as it removes a lot of duplication.
Here is an example from the Test Suite. (For Unicode and english language styles examples see there too.)

		 val ez = EzGraph()
		 // example using arrows
		 (
		   ez.b_("reto").a(FOAF.Person)
			 -- FOAF.name --> "Reto Bachman-Gmür".lang(rm)
			 -- FOAF.title --> "Mr"
			 -- FOAF.currentProject --> "http://clerezza.org/".uri
			 -- FOAF.knows --> (
			     ez.u("http://bblfish.net/#hjs").a(FOAF.Person)
			          -- FOAF.name --> "Henry Story"
			          -- FOAF.currentProject --> "http://webid.info/".uri
 			          -<- identity -- (
			                   ez.bnode.a(RSAPublicKey) //. notation because of precedence of operators
			                       -- modulus --> 65537
			                       -- public_exponent --> (bblfishModulus^^hex) // brackets needed due to precedence
			                   )
			          -- FOAF.knows -->> List(ez.b_("reto").ref,ez.b_("danny").ref)
			 )
			 -- FOAF.knows --> (ez.b_("danny").a(FOAF.Person)
			                                       -- FOAF.name --> "Danny Ayers".lang(en)
		                                               -- FOAF.knows --> "http://bblfish.net/#hjs".uri //knows
					                       -- FOAF.knows --> ez.b_("reto")
			                              )
		 )
  
> DSL for writing RDF elegantly
> -----------------------------
>
>                 Key: CLEREZZA-510
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-510
>             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 good.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira