incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Story (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (CLEREZZA-510) DSL for writing RDF elegantly
Date Thu, 30 Jun 2011 14:47:29 GMT

    [ 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

       

Mime
View raw message