PageSourceSearch

https://semopenalex.org/assets/semantic-search-action-save-search-result-4933c563c9234374549d-bundle.js

js semopenalex.org collected 2026-10-02 07:23:17 UTC 7,016 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[14102],{21553(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});const o=r(29093),s=r(38774),a=r(70796),i=r(89108),l=r(21572),u=r(22296),n=r(21572),c=r(97240),p=r(65366),d=r(34528);class h extends o.Component{dialogRef="save-search-dialog";static defaultProps={addToDefaultSet:!1};onSave=()=>{(0,u.getOverlaySystem)().show(this.dialogRef,o.createElement(n.SaveSetDialog,{onSave:this.saveAsNewSearch.bind(this),onHide:()=>(0,u.getOverlaySystem)().hide(this.dialogRef),title:"Save search",placeholder:"Search name"}))};saveAsNewSearch=e=>{const{setName:t}=e;return this.props.context.resultQuery?(0,c.QueryService)().addItem({value:i.SparqlUtil.serializeQuery(this.props.context.resultQuery.buildQuery()),queryType:"SELECT",type:"query",label:t,structure:(0,d.serializeSearch)(this.props.context.baseQueryStructure.getOrElse(void 0),this.props.context.facetStructure.getOrElse(void 0),this.props.context.resultState)}).flatMap(e=>this.props.addToDefaultSet?(0,l.addToDefaultSet)(e,this.props.id,this.props.events):s.constant(e)).onValue(e=>{(0,u.getOverlaySystem)().hide(this.dialogRef)}):null};render(){const e=o.Children.only(this.props.children),t={onClick:this.onSave};return o.cloneElement(e,t)}}t.default=function(e){const t=o.useContext(a.EventContext),r=o.useContext(p.SemanticSearchContext);return o.createElement(h,{...e,events:t,context:r})}},62541(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.LdpService=void 0,t.ldpc=function(e){return new c(e)},t.slugFromName=function(e){return e.toLowerCase().trim().replace(/[^a-zA-Z0-9~_-]+/g,"-")};const o=r(70140),s=r(38774),a=r(82329),i=r(31401),l=r(76573),u=r(80099),{VocabPlatform:n}=u.vocabularies;class c{BASE_CONTAINER;context;constructor(e,t){if(!t||t.isDefault?this.context={repository:"assets"}:this.context=t,"string"!=typeof e)throw new Error("Container IRI cannot be null or undefined");this.BASE_CONTAINER=e}getServiceUrl(e="",t={}){const r=`/container${e}`,o=i.buildQuery(a.assign({repository:this.context.repository},t));return o?`${r}?${o}`:r}static setVisibility(e,t,r){const s=u.Rdf.graph([u.Rdf.triple(u.Rdf.iri(""),n.visibilityItem,e),u.Rdf.triple(e,n.visibility,t),...a.map(r,t=>u.Rdf.triple(e,n.visibleToGroups,t))]);return new c(n.VisibilityContainer.value).addResource(s,o.Nothing())}getContainerIRI=()=>u.Rdf.iri(this.BASE_CONTAINER);getContainer(){return this.fetchResource(u.Rdf.iri(this.BASE_CONTAINER))}get(e){return this.fetchResource(e)}update(e,t){return u.turtle.serialize.serializeGraph(t).flatMap(t=>this.sendUpdateResourceRequest(e,{data:t,format:"text/turtle"})).toProperty()}options(e){const t=l.options(this.getServiceUrl()).query({uri:e.value});return s.fromNodeCallback(e=>t.end((t,r)=>e(null!=t?t.status:null,r.ok?r.text:null))).toProperty()}deleteResources(e){const t=this.getServiceUrl("",{iris:e}),r=l.del(t);return s.fromNodeCallback(e=>r.end((t,r)=>e(t,r?r.text:null))).toProperty()}addResource=(e,t=o.Nothing())=>u.turtle.serialize.serializeGraph(e).flatMap(e=>this.createResourceRequest(this.getContainerIRI(),{data:e,format:"text/turtle"},t)).map(e=>u.Rdf.iri(e)).toProperty();renameResource(e,t){const r=l.put(this.getServiceUrl("/rename")).query({uri:e.value,newName:t});return s.stream(e=>(r.end((t,r)=>{t?e.error(t):e.emit(void 0),e.end()}),()=>r.abort())).toProperty()}createResourceRequest=(e,t,r=o.Nothing())=>{let a=l.post(this.getServiceUrl()).query({uri:e.value}).send(t.data).type(t.format);return a=r.map(e=>a.set("Slug",e)).getOrElse(a),s.fromNodeCallback(e=>a.end((t,r)=>e(t,r?r.header.location:null))).toProperty()};copyResource(e,t,r=o.Nothing()){let a=l.get(this.getServiceUrl("/copyResource"));return a=t.map(t=>a.query({source:e.value,target:t.value})).getOrElse(a.query({source:e.value})),a=r.map(e=>a.set("Slug",e)).getOrElse(a),s.fromNodeCallback(e=>a.end((t,r)=>e(t,r?r.header.location:null))).toProperty()}sendUpdateResourceRequest(e,t){const r=l.put(this.getServiceUrl()).query({uri:e.value}).send(t.data).type(t.format);return s.fromNodeCallback(e=>r.end((t,r)=>{e(t,r?u.Rdf.iri(r.header.location):null)})).toProperty()}fetchResource(e){return this.getResourceTriples(e.value,"text/turtle")}
1getResourceTriples(e,t){return this.getResourceRequest(e,t).flatMap(e=>u.turtle.deserialize.turtleToGraph(e)).toProperty()}getResourceRequest(e,t){const r=l.get(this.getServiceUrl()).query({uri:e}).accept(t);return s.fromNodeCallback(r.end.bind(r)).toProperty().map(e=>e.text)}getExportURL(e){return this.getServiceUrl("/exportResource",{iris:e})}getImportURL(){return this.getServiceUrl("/importResource")}importGetTextFromURL(e){const t=l.get(e);return s.fromNodeCallback(e=>t.end((t,r)=>{e(t,r&&r.ok?r.text:null)})).toProperty()}importFromText(e,t,r){let o=l.post(this.getImportURL()).send(new File([e],"import.ttl"));return r&&(o=o.query({force:r})),t&&(o=o.query({containerIRI:t})),s.fromNodeCallback(e=>o.end((t,r)=>{e(t,r)})).toProperty()}importFromDelayedId(e,t){const r=l.post(this.getImportURL()).query({force:!0,delayedId:e,containerIRI:t});return s.fromNodeCallback(e=>r.end((t,r)=>{e(t,r)})).toProperty()}}t.LdpService=c},65366(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});r(27527).__exportStar(r(12690),t)},97240(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.QueryService=t.QueryServiceClass=void 0;const o=r(70140),s=r(82329),a=r(80099),i=r(62541),{VocabPlatform:l,rdf:u,rdfs:n,sp:c}=a.vocabularies;class p extends i.LdpService{addItem(e){const t=this.createGraph(e),r=e.label;return this.addResource(t,o.Just(r))}updateItem(e,t){const r=this.createGraph(t);return this.update(e,r)}createGraph(e){const{label:t,value:r,type:o,queryType:s}=e,i="update"===o?c.Update:c.Query,l=[a.Rdf.triple(a.Rdf.iri(""),u.type,i),a.Rdf.triple(a.Rdf.iri(""),u.type,this.getType(o,s)),a.Rdf.triple(a.Rdf.iri(""),n.label,a.Rdf.literal(t)),a.Rdf.triple(a.Rdf.iri(""),c.text,void 0!==r?a.Rdf.literal(r):a.Rdf.literal(""))];return e.structure&&l.push(a.Rdf.triple(a.Rdf.iri(""),a.vocabularies.VocabPlatform.searchState,a.Rdf.literal(e.structure))),a.Rdf.graph(l)}getType(e,t){if("update"===e)return c.Update;switch(t){case"ASK":return c.Ask;case"SELECT":default:return c.Select;case"DESCRIBE":return c.Describe;case"CONSTRUCT":return c.Construct}}getQuery(e){return this.get(e).map(t=>this.parseGraphToQuery(e,t))}parseGraphToQuery(e,t){const r=[c.Ask,c.Select,c.Describe,c.Construct,c.Update].map(e=>e.value),o=t.triples.find(t=>t.s.equals(e)&&t.p.equals(n.label)).o.value,i=t.triples.find(t=>t.s.equals(e)&&t.p.equals(c.text)).o.value,l=t.triples.find(t=>t.s.equals(e)&&t.p.equals(a.vocabularies.VocabPlatform.searchState)),p=t.triples.find(t=>t.s.equals(e)&&t.p.equals(u.type)&&(0,s.includes)(r,t.o.value)).o.value,d=this.extractTypeFromIri(p).toUpperCase();return{label:o,value:i,type:"UPDATE"===d?"update":"query",queryType:d,structure:l?l.o.value:void 0}}extractTypeFromIri(e){return/[^#]*$/.exec(e)[0]}}t.QueryServiceClass=p;t.QueryService=function(e){return new p(l.QueryContainer.value,e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.