123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429(*********************************************************************************)(* 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 *)(* *)(*********************************************************************************)(** *)openSparql_typesmoduleT=Sparql_typesletmap_opt=Misc.map_opttype('acc,'t)map_fun='accmapper->'acc->'t->'tand'amapper={var:('a,var)map_fun;iriref:('a,iriref)map_fun;prefixed_name:('a,prefixed_name)map_fun;iriloc:('a,iriloc)map_fun;iri:('a,iri)map_fun;rdf_literal:('a,rdf_literal)map_fun;data_block_value:('a,data_block_value)map_fun;data_full_block_value:('a,data_full_block_value)map_fun;inline_data_one_var:('a,inline_data_one_var)map_fun;inline_data_full:('a,inline_data_full)map_fun;datablock:('a,datablock)map_fun;values_clause:('a,values_clause)map_fun;var_or_iri:('a,var_or_iri)map_fun;blank_node:('a,blank_node)map_fun;select_var:('a,select_var)map_fun;select_vars:('a,select_vars)map_fun;select_clause:('a,select_clause)map_fun;dataset_clause:('a,dataset_clause)map_fun;arg_list:('a,arg_list)map_fun;function_call:('a,function_call)map_fun;binary_op:('a,binary_op)map_fun;expr:('a,expr)map_fun;expression:('a,expression)map_fun;built_in_call:('a,built_in_call)map_fun;aggregate:('a,aggregate)map_fun;group_var:('a,group_var)map_fun;group_condition:('a,group_condition)map_fun;constraint_:('a,constraint_)map_fun;order_condition:('a,order_condition)map_fun;limit_offset_clause:('a,limit_offset_clause)map_fun;solution_modifier:('a,solution_modifier)map_fun;bind:('a,bind)map_fun;service_graph_pattern:('a,service_graph_pattern)map_fun;graph_graph_pattern:('a,graph_graph_pattern)map_fun;graph_pattern_elt:('a,graph_pattern_elt)map_fun;graph_term:('a,graph_term)map_fun;var_or_term:('a,var_or_term)map_fun;path_one_in_prop_set:('a,path_one_in_prop_set)map_fun;path_primary:('a,path_primary)map_fun;path_elt:('a,path_elt)map_fun;path_elt_or_inverse:('a,path_elt_or_inverse)map_fun;path_sequence:('a,path_sequence)map_fun;path:('a,path)map_fun;verb:('a,verb)map_fun;triples_node:('a,triples_node)map_fun;graph_node:('a,graph_node)map_fun;prop_object_list:('a,prop_object_list)map_fun;triples_block:('a,triples_block)map_fun;triples_same_subject:('a,triples_same_subject)map_fun;ggp_sub:('a,ggp_sub)map_fun;group_graph_pattern:('a,group_graph_pattern)map_fun;sub_select:('a,sub_select)map_fun;}letvarfacct=tletirireffacct=tletprefixed_namefacct=tletirilocfacct=tletirifacc=function|Irirefi->Iriref(f.irireffacci)|PrefixedNamep->PrefixedName(f.prefixed_namefaccp)|Irir->Iri(f.irilocfaccr)letrdf_literalfacct=tletdata_block_valuefacc=function|DataBlockValueIriiri->DataBlockValueIri(f.irifacciri)|DataBlockValueRdflit->DataBlockValueRdf(f.rdf_literalfacclit)|DataBlockValueNumericlit->DataBlockValueNumeric(f.rdf_literalfacclit)|DataBlockValueBooleanlit->DataBlockValueBoolean(f.rdf_literalfacclit)|DataBlockValueUndef->DataBlockValueUndef;;letdata_full_block_valuefacc=function|Nil->Nil|Valuel->Value(List.map(f.data_block_valuefacc)l);;letinline_data_one_varfacct={idov_loc=t.idov_loc;idov_var=f.varfacct.idov_var;idov_data=List.map(f.data_block_valuefacc)t.idov_data;};;letinline_data_fullfacct={idf_loc=t.idf_loc;idf_vars=List.map(f.varfacc)t.idf_vars;idf_values=List.map(f.data_full_block_valuefacc)t.idf_values;};;letdatablockfacc=function|InLineDataOneVard->InLineDataOneVar(f.inline_data_one_varfaccd)|InLineDataFulld->InLineDataFull(f.inline_data_fullfaccd);;letvalues_clausefacc=functionNone->None|Somed->Some(f.datablockfaccd);;letvar_or_irifacc=function|VIVarvar->VIVar(f.varfaccvar)|VIIriiri->VIIri(f.irifacciri);;letblank_nodefacct=tletselect_varfacct={sel_var_loc=t.sel_var_loc;sel_var_expr=map_opt(f.expressionfacc)t.sel_var_expr;sel_var=f.varfacct.sel_var;}andselect_varsfacc=function|SelectAll->SelectAll|SelectVarsl->SelectVars(List.map(f.select_varfacc)l)andselect_clausefacct={sel_flag=t.sel_flag;sel_vars=f.select_varsfacct.sel_vars;}anddataset_clausefacc=function|DefaultGraphClauses->DefaultGraphClause(f.irifaccs)|NamedGraphClauses->NamedGraphClause(f.irifaccs)andarg_listfacct={argl_loc=t.argl_loc;argl_distinct=t.argl_distinct;argl=List.map(f.expressionfacc)t.argl;}andfunction_callfacct={func_loc=t.func_loc;func_iri=f.irifacct.func_iri;func_args=f.arg_listfacct.T.func_args;}andbinary_opfacct=tandexprfacc=function|EVarvar->EVar(f.varfaccvar)|EIriiri->EIri(f.irifacciri)|EBin(e1,op,e2)->EBin(f.expressionfacce1,f.binary_opfaccop,f.expressionfacce2)|ENote->ENot(f.expressionfacce)|EUMinuse->EUMinus(f.expressionfacce)|EBicc->EBic(f.built_in_callfaccc)|EFuncallc->EFuncall(f.function_callfaccc)|ELitlit->ELit(f.rdf_literalfacclit)|ENumericlit->ENumeric(f.rdf_literalfacclit)|EBooleanlit->EBoolean(f.rdf_literalfacclit)|EIn(e,l)->EIn(f.expressionfacce,List.map(f.expressionfacc)l)|ENotIn(e,l)->ENotIn(f.expressionfacce,List.map(f.expressionfacc)l)andexpressionfacct={expr_loc=t.expr_loc;T.expr=f.exprfacct.T.expr;}andbuilt_in_callfacc=function|Bic_aggagg->Bic_agg(f.aggregatefaccagg)|Bic_fun(name,l)->Bic_fun(name,List.map(f.expressionfacc)l)|Bic_BOUNDv->Bic_BOUND(f.varfaccv)|Bic_EXISTSggp->Bic_EXISTS(f.group_graph_patternfaccggp)|Bic_NOTEXISTSggp->Bic_NOTEXISTS(f.group_graph_patternfaccggp)andaggregatefacc=function|Bic_COUNT(d,e)->Bic_COUNT(d,map_opt(f.expressionfacc)e)|Bic_SUM(d,e)->Bic_SUM(d,f.expressionfacce)|Bic_MIN(d,e)->Bic_MIN(d,f.expressionfacce)|Bic_MAX(d,e)->Bic_MAX(d,f.expressionfacce)|Bic_AVG(d,e)->Bic_AVG(d,f.expressionfacce)|Bic_SAMPLE(d,e)->Bic_SAMPLE(d,f.expressionfacce)|Bic_GROUP_CONCAT(d,e,sopt)->Bic_GROUP_CONCAT(d,f.expressionfacce,sopt)andgroup_varfacct={grpvar_loc=t.grpvar_loc;grpvar_expr=map_opt(f.expressionfacc)t.grpvar_expr;grpvar=map_opt(f.varfacc)t.grpvar;}andgroup_conditionfacc=function|GroupBuiltInCallc->GroupBuiltInCall(f.built_in_callfaccc)|GroupFunctionCallc->GroupFunctionCall(f.function_callfaccc)|GroupVargv->GroupVar(f.group_varfaccgv)andconstraint_facc=function|ConstrBuiltInCallc->ConstrBuiltInCall(f.built_in_callfaccc)|ConstrFunctionCallc->ConstrFunctionCall(f.function_callfaccc)|ConstrExpre->ConstrExpr(f.expressionfacce)andorder_conditionfacc=function|OrderAsce->OrderAsc(f.expressionfacce)|OrderDesce->OrderDesc(f.expressionfacce)|OrderConstrc->OrderConstr(f.constraint_faccc)|OrderVarv->OrderVar(f.varfaccv)andlimit_offset_clausefacct=tandsolution_modifierfacct={solmod_loc=t.solmod_loc;solmod_group=List.map(f.group_conditionfacc)t.solmod_group;solmod_having=List.map(f.constraint_facc)t.solmod_having;solmod_order=map_opt(List.map(f.order_conditionfacc))t.solmod_order;solmod_limoff=map_opt(f.limit_offset_clausefacc)t.solmod_limoff;}andbindfacct={bind_loc=t.bind_loc;bind_expr=f.expressionfacct.bind_expr;bind_var=f.varfacct.bind_var;}andservice_graph_patternfacct={servgp_loc=t.servgp_loc;servgp_silent=t.servgp_silent;servgp_name=f.var_or_irifacct.servgp_name;servgp_pat=f.group_graph_patternfacct.servgp_pat;}andgraph_graph_patternfacct={graphgp_loc=t.graphgp_loc;graphgp_name=f.var_or_irifacct.graphgp_name;graphgp_pat=f.group_graph_patternfacct.graphgp_pat;}andgraph_pattern_eltfacc=function|Triplest->Triples(f.triples_blockfacct)|Unionl->Union(List.map(f.group_graph_patternfacc)l)|Optionalggp->Optional(f.group_graph_patternfaccggp)|Minusggp->Minus(f.group_graph_patternfaccggp)|GGPg->GGP(f.graph_graph_patternfaccg)|Servicep->Service(f.service_graph_patternfaccp)|Filterc->Filter(f.constraint_faccc)|Bindb->Bind(f.bindfaccb)|InlineDatad->InlineData(f.datablockfaccd)andgraph_termfacc=function|GraphTermIriiri->GraphTermIri(f.irifacciri)|GraphTermLitlit->GraphTermLit(f.rdf_literalfacclit)|GraphTermNumericlit->GraphTermNumeric(f.rdf_literalfacclit)|GraphTermBooleanlit->GraphTermBoolean(f.rdf_literalfacclit)|GraphTermBlankb->GraphTermBlank(f.blank_nodefaccb)|GraphTermNil->GraphTermNil|GraphTermNode_->assertfalseandvar_or_termfacc=function|Varv->Var(f.varfaccv)|GraphTermt->GraphTerm(f.graph_termfacct)andpath_one_in_prop_setfacc=function|PathOneInIriiri->PathOneInIri(f.irifacciri)|PathOneInA->PathOneInA|PathOneInNotIriiri->PathOneInNotIri(f.irifacciri)|PathOneInNotA->PathOneInNotAandpath_primaryfacc=function|PathIriiri->PathIri(f.irifacciri)|PathA->PathA|PathNegPropSetl->PathNegPropSet(List.map(f.path_one_in_prop_setfacc)l)|Pathp->Path(f.pathfaccp)andpath_eltfacct={pelt_loc=t.pelt_loc;pelt_mod=t.pelt_mod;pelt_primary=f.path_primaryfacct.pelt_primary;}andpath_elt_or_inversefacc=function|Eltp->Elt(f.path_eltfaccp)|Invp->Inv(f.path_eltfaccp)andpath_sequencefaccl=List.map(f.path_elt_or_inversefacc)landpathfaccl=List.map(f.path_sequencefacc)landverbfacc=function|VerbPathp->VerbPath(f.pathfaccp)|VerbVarv->VerbVar(f.varfaccv)|VerbIrii->VerbIri(f.irifacci)|VerbA->VerbAandtriples_nodefacc=function|TNodeCollectionl->TNodeCollection(List.map(f.graph_nodefacc)l)|TNodeBlankl->TNodeBlank(List.map(f.prop_object_listfacc)l)andgraph_nodefacc=function|GraphNodeVTt->GraphNodeVT(f.var_or_termfacct)|GraphNodeTriplest->GraphNodeTriples(f.triples_nodefacct)andprop_object_listfacct={propol_loc=t.propol_loc;propol_verb=f.verbfacct.propol_verb;propol_objects=List.map(f.graph_nodefacc)t.propol_objects;}andtriples_blockfacct={triples_loc=t.triples_loc;triples=List.map(f.triples_same_subjectfacc)t.triples;}andtriples_same_subjectfacc=function|TriplesVar(t,l)->TriplesVar(f.var_or_termfacct,List.map(f.prop_object_listfacc)l)|TriplesNode(t,l)->TriplesNode(f.triples_nodefacct,List.map(f.prop_object_listfacc)l)andggp_subfacct={ggp_sub_loc=t.ggp_sub_loc;ggp_sub_elts=List.map(f.graph_pattern_eltfacc)t.ggp_sub_elts;}andgroup_graph_patternfacc=function|SubSelects->SubSelect(f.sub_selectfaccs)|GGPSubg->GGPSub(f.ggp_subfaccg)andsub_selectfacct={subsel_loc=t.subsel_loc;subsel_select=f.select_clausefacct.subsel_select;subsel_where=f.group_graph_patternfacct.subsel_where;subsel_modifier=f.solution_modifierfacct.subsel_modifier;subsel_values=f.values_clausefacct.subsel_values;}letdefault={var;iriref;prefixed_name;iriloc;iri;rdf_literal;data_block_value;data_full_block_value;inline_data_one_var;inline_data_full;datablock;values_clause;var_or_iri;blank_node;select_var;select_vars;select_clause;dataset_clause;arg_list;function_call;binary_op;expr;expression;built_in_call;aggregate;group_var;group_condition;constraint_;order_condition;limit_offset_clause;solution_modifier;bind;service_graph_pattern;graph_graph_pattern;graph_pattern_elt;graph_term;var_or_term;path_one_in_prop_set;path_primary;path_elt;path_elt_or_inverse;path_sequence;path;verb;triples_node;graph_node;prop_object_list;triples_block;triples_same_subject;ggp_sub;group_graph_pattern;sub_select;}