more operations;
authorwenzelm
Thu, 14 Feb 2019 16:25:12 +0100
changeset 69808 c64197a224c6
parent 69807 3389fda6cffd
child 69809 028f61045e8d
more operations;
src/Pure/General/rdf.scala
--- a/src/Pure/General/rdf.scala	Thu Feb 14 15:46:38 2019 +0100
+++ b/src/Pure/General/rdf.scala	Thu Feb 14 16:25:12 2019 +0100
@@ -39,4 +39,14 @@
 
   def description(subject: String, body: XML.Body, attributes: XML.Attributes = Nil): XML.Elem =
     XML.Elem(Markup(rdf("Description"), (rdf("about"), subject) :: attributes), body)
+
+
+  /* collections */
+
+  def collection(kind: String, items: List[XML.Body]): XML.Elem =
+    XML.elem(kind, items.map(item => XML.elem(rdf("li"), item)))
+
+  def bag(items: List[XML.Body]): XML.Elem = collection(rdf("Bag"), items)
+  def seq(items: List[XML.Body]): XML.Elem = collection(rdf("Seq"), items)
+  def alt(items: List[XML.Body]): XML.Elem = collection(rdf("Alt"), items)
 }