aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorarie <arie@alleycat.cc>2021-05-04 15:24:53 +0200
committerarie <arie@alleycat.cc>2021-05-04 15:24:53 +0200
commitfc0f68f94b1a22e53931670610c4570bbaa9fac6 (patch)
tree5685a0fb29498cb5d5e64e93d243440b463215a4 /test
parent128d4f88ce14c3ce212546d21387b77c89c7851b (diff)
See previous commit
Diffstat (limited to 'test')
-rw-r--r--test/gen/rdf_gen.ml47
1 files changed, 46 insertions, 1 deletions
diff --git a/test/gen/rdf_gen.ml b/test/gen/rdf_gen.ml
index 12a7692..741f0b0 100644
--- a/test/gen/rdf_gen.ml
+++ b/test/gen/rdf_gen.ml
@@ -9,7 +9,11 @@ module Iri = Rdf.Iri
module Blank_node = Rdf.Blank_node
module Literal = Rdf.Literal
module Term = Rdf.Term
-
+module Triple = Rdf.Triple
+module Subject = Triple.Subject
+module Predicate = Triple.Predicate
+module Object = Triple.Object
+module Namespace = Rdf.Namespace
let iri =
QCheck.Gen.(
@@ -37,3 +41,44 @@ let term =
blank_node |> map Term.of_blank_node;
literal |> map Term.of_literal]
|> choose)
+
+let subject =
+ QCheck.(
+ [iri |> map (Subject.of_iri);
+ blank_node |> map( Subject.of_blank_node);
+ ]
+ |> choose
+ )
+
+let predicate =
+ iri |> QCheck.map (Predicate.of_iri)
+
+let object' =
+ QCheck.(
+ [iri |> map( Object.of_iri);
+ blank_node |> map (Object.of_blank_node);
+ literal |> map (Object.of_literal);
+ ]
+ |> choose)
+
+let triple =
+ QCheck.triple
+ subject
+ predicate
+ object'
+ |> QCheck.map (fun(s,p,o) -> Triple.make s p o)
+
+let rdf =
+ QCheck.string
+ |> QCheck.map(Namespace.rdf)
+
+let rdfs =
+ QCheck.string
+ |> QCheck.map(Namespace.rdfs)
+let owl =
+ QCheck.string
+ |> QCheck.map(Namespace.owl)
+
+let xsd =
+ QCheck.string
+ |> QCheck.map(Namespace.xsd)