(*********************************************************************************)
(*                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 rdf_str = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";;
let rdf = Iri.of_string rdf_str ;;
let rdf_ s = Iri.of_string (rdf_str ^ s);;

let xsd_str = "http://www.w3.org/2001/XMLSchema#" ;;
let xsd = Iri.of_string xsd_str ;;
let xsd_ s = Iri.of_string (xsd_str^s) ;;

let about = rdf_"about";;
let id = rdf_"ID";;
let nodeID = rdf_"nodeID";;
let datatype = rdf_"datatype";;
let description = rdf_"Description";;
let li = rdf_"li";;
let _RDF = rdf_"RDF";;
let parseType = rdf_"parseType";;
let resource = rdf_"resource";;
let json = rdf_"JSON";;

let c_Alt = rdf_ "Alt" ;;
let c_Bag = rdf_ "Bag" ;;
let first = rdf_ "first" ;;
let dt_HTML = rdf_ "HTML" ;;
let dt_JSON = rdf_ "JSON" ;;
let dt_langString = rdf_ "langString" ;;
let language = rdf_ "language" ;;
let c_List = rdf_ "List" ;;
let object_ = rdf_ "object" ;;
let dt_PlainLiteral = rdf_ "PlainLiteral" ;;
let predicate = rdf_ "predicate" ;;
let c_CompoundLiteral = rdf_ "CompoundLiteral" ;;
let c_Property = rdf_ "Property" ;;
let rest = rdf_ "rest" ;;
let c_Seq = rdf_ "Seq" ;;
let c_Statement = rdf_ "Statement" ;;
let subject = rdf_ "subject" ;;
let type_ = rdf_ "type" ;;
let value = rdf_ "value" ;;
let dt_XMLLiteral = rdf_ "XMLLiteral" ;;
let direction = rdf_ "direction" ;;

let n n = rdf_("_"^(string_of_int n));;
let nil = rdf_"nil"

let xsd_int = xsd_"int";;
let xsd_integer = xsd_"integer";;
let xsd_byte = xsd_"byte";;
let xsd_long = xsd_"long";;
let xsd_negativeInteger = xsd_"negativeInteger";;
let xsd_nonNegativeInteger = xsd_"nonNegativeInteger";;
let xsd_nonPositiveInteger = xsd_"nonPositiveInteger";;
let xsd_positiveInteger = xsd_"positiveInteger";;
let xsd_short = xsd_"short";;
let xsd_unsignedLong = xsd_"unsignedLong";;
let xsd_unsignedInt = xsd_"unsignedInt";;
let xsd_unsignedShort = xsd_"unsignedShort";;
let xsd_unsignedByte = xsd_"unsignedByte";;
let xsd_double = xsd_"double";;
let xsd_decimal = xsd_"decimal";;
let xsd_boolean = xsd_"boolean";;
let xsd_string = xsd_"string";;
let xsd_datetime = xsd_"dateTime";;
let xsd_hexBinary = xsd_"hexBinary";;
let xsd_JSON = xsd_"JSON";;


let integer_types = Iri.Set.of_list [
    xsd_integer ;
    xsd_int;
    xsd_byte ;
    xsd_long ;
    xsd_negativeInteger ;
    xsd_nonNegativeInteger ;
    xsd_nonPositiveInteger ;
    xsd_positiveInteger ;
    xsd_short ;
    xsd_unsignedLong ;
    xsd_unsignedInt ;
    xsd_unsignedShort ;
    xsd_unsignedByte ;
]

module Open = struct
    let rdf_about = about
    let rdf_id = id
    let rdf_datatype = datatype
    let rdf_description = description
    let rdf_li = li
    let rdf_nodeID = nodeID
    let rdf_RDF = rdf
    let rdf_parseType = parseType
    let rdf_resource = resource
    let rdf_json = json

    let rdf_c_Alt = c_Alt
    let rdf_c_Bag = c_Bag
    let rdf_c_CompoundLiteral = c_CompoundLiteral
    let rdf_first = first
    let rdf_dt_HTML = dt_HTML
    let rdf_dt_JSON = dt_JSON
    let rdf_dt_langString = dt_langString
    let rdf_language = language
    let rdf_c_List = c_List
    let rdf_object = object_
    let rdf_dt_PlainLiteral = dt_PlainLiteral
    let rdf_predicate = predicate
    let rdf_c_Property = c_Property
    let rdf_rest = rest
    let rdf_c_Seq = c_Seq
    let rdf_c_Statement = c_Statement
    let rdf_subject = subject
    let rdf_type = type_
    let rdf_value = value
    let rdf_dt_XMLLiteral = dt_XMLLiteral
    let rdf_direction = direction

    let rdf_n = n
    let rdf_nil = nil

    let xsd_integer = xsd_integer
    let xsd_double = xsd_double
    let xsd_decimal = xsd_decimal
    let xsd_boolean = xsd_boolean
    let xsd_string = xsd_string
    let xsd_datetime = xsd_datetime
    let xsd_hexBinary = xsd_hexBinary
    let xsd_JSON = xsd_JSON
end
