package rdf

  1. Overview
  2. Docs
OCaml library to manipulate RDF graphs; implements SPARQL

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-rdf-1.0.0.tar.gz
md5=43ce517489f775e6b65fcdef5e713e74
sha512=6130e46d186ca4abf0c44a35ab040f696f8b4d10fd16db9212e8280500f8263626f0ab8d53479b926924b41e45ae4793251727de725c03c409052a96ad2d40bd

doc/src/rdf/earl.ml.html

Source file earl.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
(*********************************************************************************)
(*                OCaml-RDF                                                      *)
(*                                                                               *)
(*    Copyright (C) 2012-2024 Institut National de Recherche en Informatique     *)
(*    et en Automatique. All rights reserved.                                    *)
(*                                                                               *)
(*    This program is free software; you can redistribute it and/or modify       *)
(*    it under the terms of the GNU Lesser General Public License version        *)
(*    3 as published by the Free Software Foundation.                            *)
(*                                                                               *)
(*    This program is distributed in the hope that it will be useful,            *)
(*    but WITHOUT ANY WARRANTY; without even the implied warranty of             *)
(*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *)
(*    GNU General Public License for more details.                               *)
(*                                                                               *)
(*    You should have received a copy of the GNU General Public License          *)
(*    along with this program; if not, write to the Free Software                *)
(*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA                   *)
(*    02111-1307  USA                                                            *)
(*                                                                               *)
(*    Contact: Maxence.Guesdon@inria.fr                                          *)
(*                                                                               *)
(*********************************************************************************)

let earl_str = "http://www.w3.org/ns/earl#";;
let earl = Iri.of_string earl_str ;;
let earl_ s = Iri.of_string (earl_str ^ s);;

let c_Assertion = earl_ "Assertion" ;;
let c_Assertor = earl_ "Assertor" ;;
let c_CannotTell = earl_ "CannotTell" ;;
let c_Fail = earl_ "Fail" ;;
let c_NotApplicable = earl_ "NotApplicable" ;;
let c_NotTested = earl_ "NotTested" ;;
let c_OutcomeValue = earl_ "OutcomeValue" ;;
let c_Pass = earl_ "Pass" ;;
let c_Software = earl_ "Software" ;;
let c_TestCase = earl_ "TestCase" ;;
let c_TestCriterion = earl_ "TestCriterion" ;;
let c_TestMode = earl_ "TestMode" ;;
let c_TestRequirement = earl_ "TestRequirement" ;;
let c_TestResult = earl_ "TestResult" ;;
let c_TestSubject = earl_ "TestSubject" ;;
let assertedBy = earl_ "assertedBy" ;;
let info = earl_ "info" ;;
let mainAssertor = earl_ "mainAssertor" ;;
let mode = earl_ "mode" ;;
let outcome = earl_ "outcome" ;;
let pointer = earl_ "pointer" ;;
let result = earl_ "result" ;;
let subject = earl_ "subject" ;;
let test = earl_ "test" ;;

module Open = struct
  let earl_c_Assertion = c_Assertion
  let earl_c_Assertor = c_Assertor
  let earl_c_CannotTell = c_CannotTell
  let earl_c_Fail = c_Fail
  let earl_c_NotApplicable = c_NotApplicable
  let earl_c_NotTested = c_NotTested
  let earl_c_OutcomeValue = c_OutcomeValue
  let earl_c_Pass = c_Pass
  let earl_c_Software = c_Software
  let earl_c_TestCase = c_TestCase
  let earl_c_TestCriterion = c_TestCriterion
  let earl_c_TestMode = c_TestMode
  let earl_c_TestRequirement = c_TestRequirement
  let earl_c_TestResult = c_TestResult
  let earl_c_TestSubject = c_TestSubject
  let earl_assertedBy = assertedBy
  let earl_info = info
  let earl_mainAssertor = mainAssertor
  let earl_mode = mode
  let earl_outcome = outcome
  let earl_pointer = pointer
  let earl_result = result
  let earl_subject = subject
  let earl_test = test
end

class from ?sub g =
  let sub = match sub with None -> Term.Iri (g.Graph.name()) | Some t -> t in
  object(self)
  method assertedBy = g.Graph.objects_of ~sub ~pred: assertedBy
  method assertedBy_opt = match self#assertedBy with [] -> None | x::_ -> Some x
  method assertedBy_iris = Graph.only_iris (self#assertedBy)
  method assertedBy_opt_iri = match self#assertedBy_iris with [] -> None | x::_ -> Some x
  method info = Graph.literal_objects_of g ~sub ~pred: info
  method info_opt = match self#info with [] -> None | x::_ -> Some x
  method mainAssertor = g.Graph.objects_of ~sub ~pred: mainAssertor
  method mainAssertor_opt = match self#mainAssertor with [] -> None | x::_ -> Some x
  method mainAssertor_iris = Graph.only_iris (self#mainAssertor)
  method mainAssertor_opt_iri = match self#mainAssertor_iris with [] -> None | x::_ -> Some x
  method mode = g.Graph.objects_of ~sub ~pred: mode
  method mode_opt = match self#mode with [] -> None | x::_ -> Some x
  method mode_iris = Graph.only_iris (self#mode)
  method mode_opt_iri = match self#mode_iris with [] -> None | x::_ -> Some x
  method outcome = g.Graph.objects_of ~sub ~pred: outcome
  method outcome_opt = match self#outcome with [] -> None | x::_ -> Some x
  method outcome_iris = Graph.only_iris (self#outcome)
  method outcome_opt_iri = match self#outcome_iris with [] -> None | x::_ -> Some x
  method pointer = g.Graph.objects_of ~sub ~pred: pointer
  method pointer_opt = match self#pointer with [] -> None | x::_ -> Some x
  method pointer_iris = Graph.only_iris (self#pointer)
  method pointer_opt_iri = match self#pointer_iris with [] -> None | x::_ -> Some x
  method result = g.Graph.objects_of ~sub ~pred: result
  method result_opt = match self#result with [] -> None | x::_ -> Some x
  method result_iris = Graph.only_iris (self#result)
  method result_opt_iri = match self#result_iris with [] -> None | x::_ -> Some x
  method subject = g.Graph.objects_of ~sub ~pred: subject
  method subject_opt = match self#subject with [] -> None | x::_ -> Some x
  method subject_iris = Graph.only_iris (self#subject)
  method subject_opt_iri = match self#subject_iris with [] -> None | x::_ -> Some x
  method test = g.Graph.objects_of ~sub ~pred: test
  method test_opt = match self#test with [] -> None | x::_ -> Some x
  method test_iris = Graph.only_iris (self#test)
  method test_opt_iri = match self#test_iris with [] -> None | x::_ -> Some x
  end
OCaml

Innovation. Community. Security.