[
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