import{j as e,S as a,h as d,r as p,v as w,H as g}from"./vendor-ClLR6ncd.js";import{o as R,h as f,i as y,f as v,M as D}from"./index-OtVJl4GC.js";import"./lodash-ZyeDnt0e.js";import{S as b,E as j}from"./Messages-BRmQDxrZ.js";import{M}from"./MultipleSelectWithCheckboxes-BT7l66Wa.js";import{n as T,a as W}from"./inputsContext-DcO_XRZd.js";import{C as O}from"./CheckboxWithLabel-D5KtBcIx.js";import{C as z}from"./CreateDialogContext-Buan56-U.js";import{D as E}from"./index-DY-IkI-n.js";import{u as k}from"./model-BBaroEiB.js";import{L as h}from"./Link-BLwKPJFF.js";import{D as A}from"./Divider-DZzUGEvZ.js";import"./MenuItem-CCerWMyq.js";import"./dividerClasses-DvO85-mA.js";import"./DialogContent-DR8Wx7Lo.js";import"./DialogTitle-i0lt2jWQ.js";const x=[{label:"Same As",value:"same-as"},{label:"Restriction",value:"restriction"},{label:"Values From",value:"values-from",secondary:'a special subset of "Restriction" rule'},{label:"Class",value:"class"},{label:"Property",value:"property"}];function I(){const[r,i]=p.useState(x.map(({value:s})=>s)),u=x.map(s=>s.value==="values-from"?{...s,disabled:!r.includes("restriction")}:s),o=r.length===0,S=s=>i(s.includes("restriction")?s:s.filter(c=>c!=="values-from")),[n,C]=p.useState(""),l=n===""?!1:W(n),[m,L]=p.useState(!1),t=f((s,c)=>y({url:v(c,"materializeEntailed"),method:"put",params:{with:r,useTypeSubproperty:m,commit:n},paramsSerializer:{indexes:null}}),{invalidateRepoKeysOnSuccess:[]});return e.jsxs(a,{spacing:1,alignItems:"flex-start",children:[e.jsx(d,{sx:{alignSelf:"center"},children:"Apply reasoning"}),t.isSuccess?e.jsx(b,{message:`Generated ${t.data} triples!`,reset:t.reset}):null,t.isError?e.jsx(j,{error:t.error,reset:t.reset}):null,e.jsx(M,{sx:{width:350},disabled:t.isLoading,options:u,selected:r,setSelected:S,label:"Rules"}),e.jsx(w,{sx:{width:350},variant:"standard",disabled:t.isLoading,value:n,placeholder:"100000",onChange:s=>C(s.target.value),error:l,helperText:l?T("commit"):"Specifies the size of materialization commits.",label:"Commits"}),e.jsx(O,{label:"Use type subproperty",title:'When "Use Type Subproperty" is enabled and possible, the materializer prefers using types which are rdfs:subPropertyOf rdf:type rather than rdf:type directly.',setter:L,value:m,disabled:t.isLoading}),e.jsx(D,{title:o?"Select at least one rule":l?"Commit must be either an integer or empty":void 0,children:e.jsx(g,{variant:"contained",sx:{alignSelf:"center"},disabled:o||l||t.isLoading,onClick:t.mutate,children:t.isLoading?"Applying...":"Apply"})})]})}const{useDialogContext:P,DialogContextProvider:_}=z();function U(){const r=P(),i=f((u,o)=>y({url:v(o,"materializeEntailed"),method:"delete"}),{onSettled:()=>{r.resetOpenParameter()},invalidateRepoKeysOnSuccess:[]});return e.jsxs(e.Fragment,{children:[e.jsx(E,{...r,dialogTitle:"Clear reasoning",dialogBodyMessage:"Are you sure you want to delete all generated triples in the repository?",submitTitle:"Delete",onSubmit:i.mutate}),e.jsxs(a,{justifyContent:"space-between",sx:{height:1,pl:2},children:[e.jsxs(a,{spacing:1,children:[e.jsx(d,{sx:{alignSelf:"center"},children:"Clear reasoning"}),i.isSuccess?e.jsx(b,{message:"Deleted generated triples!",reset:i.reset}):null,i.isError?e.jsx(j,{error:i.error,reset:i.reset}):null]}),e.jsx(g,{sx:{alignSelf:"center"},variant:"contained",color:"error",onClick:()=>r.open(!0),children:"delete"})]})]})}function se(){const r=k("materializer.html");return e.jsxs(a,{spacing:R(),sx:{flexGrow:1},children:[e.jsx(d,{variant:"h4",children:"Manage reasoning"}),e.jsxs(d,{variant:"subtitle2",color:"text.secondary",children:["AllegroGraph provides OWL 2 RL materializer which uses a set of inference rules to generate new triples and adds them to the triple-store."," ",e.jsx(h,{href:"https://www.w3.org/TR/owl2-profiles/#OWL_2_RL",target:"_blank",rel:"noreferrer",children:"OWL 2 RL"})," ","is the subset of OWL 2 that is designed to support rule-based reasoners. OWL 2 RL contains a large number of rules for generating triples and some rules for verifying that the triple store is consistent with respect to the OWL 2 RL ontology. For more details please see"," ",e.jsx(h,{href:r,target:"_blank",children:"the documentation"}),"."]}),e.jsxs(a,{direction:"row",divider:e.jsx(A,{flexItem:!0,orientation:"vertical"}),children:[e.jsx("div",{style:{minWidth:"49%"},children:e.jsx(I,{})}),e.jsx("div",{style:{minWidth:"49%"},children:e.jsx(_,{children:e.jsx(U,{})})})]})]})}export{se as default};
