PageSourceSearch

https://semopenalex.org/assets/mp-ldp-export-resource-cd2a1a27be4bf40477dc-bundle.js

js semopenalex.org collected 2026-10-02 07:24:25 UTC 7,086 bytes, 1 lines download raw bytes

1(self.webpackChunk=self.webpackChunk||[]).push([[26427],{11239(e,t,r){e.exports=r(16293)(4018)},31646(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLabel=function(e,t){return i.getResource(e,t?.context,t?.appContext)},t.getLabels=function(e,t){return i.getResources(e,t?.context,t?.appContext)};const o=r(26215),s=r(72273),i=new class extends s.BaseResourceService{constructor(){super("/rest/data/rdf/utils/getLabelsForRdfValue")}createRequest(e,t,r){const s=super.createRequest(e,t,r),i=(0,o.getPreferredUserLanguage)();return s.query({preferredLanguage:i}),s}}},62541(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LdpService=void 0,t.ldpc=function(e){return new u(e)},t.slugFromName=function(e){return e.toLowerCase().trim().replace(/[^a-zA-Z0-9~_-]+/g,"-")};const o=r(70140),s=r(38774),i=r(82329),n=r(31401),c=r(76573),a=r(80099),{VocabPlatform:l}=a.vocabularies;class u{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=n.buildQuery(i.assign({repository:this.context.repository},t));return o?`${r}?${o}`:r}static setVisibility(e,t,r){const s=a.Rdf.graph([a.Rdf.triple(a.Rdf.iri(""),l.visibilityItem,e),a.Rdf.triple(e,l.visibility,t),...i.map(r,t=>a.Rdf.triple(e,l.visibleToGroups,t))]);return new u(l.VisibilityContainer.value).addResource(s,o.Nothing())}getContainerIRI=()=>a.Rdf.iri(this.BASE_CONTAINER);getContainer(){return this.fetchResource(a.Rdf.iri(this.BASE_CONTAINER))}get(e){return this.fetchResource(e)}update(e,t){return a.turtle.serialize.serializeGraph(t).flatMap(t=>this.sendUpdateResourceRequest(e,{data:t,format:"text/turtle"})).toProperty()}options(e){const t=c.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=c.del(t);return s.fromNodeCallback(e=>r.end((t,r)=>e(t,r?r.text:null))).toProperty()}addResource=(e,t=o.Nothing())=>a.turtle.serialize.serializeGraph(e).flatMap(e=>this.createResourceRequest(this.getContainerIRI(),{data:e,format:"text/turtle"},t)).map(e=>a.Rdf.iri(e)).toProperty();renameResource(e,t){const r=c.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 i=c.post(this.getServiceUrl()).query({uri:e.value}).send(t.data).type(t.format);return i=r.map(e=>i.set("Slug",e)).getOrElse(i),s.fromNodeCallback(e=>i.end((t,r)=>e(t,r?r.header.location:null))).toProperty()};copyResource(e,t,r=o.Nothing()){let i=c.get(this.getServiceUrl("/copyResource"));return i=t.map(t=>i.query({source:e.value,target:t.value})).getOrElse(i.query({source:e.value})),i=r.map(e=>i.set("Slug",e)).getOrElse(i),s.fromNodeCallback(e=>i.end((t,r)=>e(t,r?r.header.location:null))).toProperty()}sendUpdateResourceRequest(e,t){const r=c.put(this.getServiceUrl()).query({uri:e.value}).send(t.data).type(t.format);return s.fromNodeCallback(e=>r.end((t,r)=>{e(t,r?a.Rdf.iri(r.header.location):null)})).toProperty()}fetchResource(e){return this.getResourceTriples(e.value,"text/turtle")}getResourceTriples(e,t){return this.getResourceRequest(e,t).flatMap(e=>a.turtle.deserialize.turtleToGraph(e)).toProperty()}getResourceRequest(e,t){const r=c.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=c.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=c.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)=>
1{e(t,r)})).toProperty()}importFromDelayedId(e,t){const r=c.post(this.getImportURL()).query({force:!0,delayedId:e,containerIRI:t});return s.fromNodeCallback(e=>r.end((t,r)=>{e(t,r)})).toProperty()}}t.LdpService=u},72273(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseResourceService=void 0;const o=r(74344),s=r(38774),i=r(26742),n=r(58215),c=r(76516),a=r(76573);function l(e){return e&&e.repository?e.repository:"default"}t.BaseResourceService=class{serviceUrl;pools=new Map;constructor(e){this.serviceUrl=e}getPool(e,t){const r=function(e,t){let r=e?.repository??"default";t?.type&&(r+=`-${t.type}-${t.identifier?t.identifier:"no_identifier"}`);return r}(e,t),o=l(e);return this.pools.has(r)||this.pools.set(r,new c.BatchedPool({fetch:e=>this.fetchResources(e.toArray(),o,t)})),this.pools.get(r)}getResource(e,t,r){return this.getPool(t,r).query(e.value)}getResources(e,t,r){if(0===e.length)return s.constant(o.Map());const i=this.getPool(t,r);if(e.length>=i.batchSize){const s=l(t);return this.fetchResources(e.map(e=>e.value),s,r).map(t=>o.Map().withMutations(r=>{for(const o of e)r.set(o,t.get(o.value))}))}const n=e.map(e=>this.getResource(e,t,r).map(t=>[e,t]));return s.combine(n).map(o.Map).toProperty()}createRequest(e,t,r){const o=(0,a.post)(this.serviceUrl).send(e).query({repository:t}).type("application/json").accept("application/json");return(0,i.applyApplicationContextParameters)(o,r)}fetchResources(e,t,r){const s=this.createRequest(e,t,r);return(0,n.requestAsProperty)(s).map(e=>{const t=e.body;return o.Map(t)})}}},75817(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExportResource=void 0;const o=r(82329),s=r(66070),i=r(11239),n=r(29093),c=r(58215),a=r(78025),l=r(76573),u=r(80099),p=r(62541),d=r(31646);function h(e){return o.has(e,"iri")}function f(e){return o.has(e,"selection")}class R extends a.Component{cancellation=new c.Cancellation;constructor(e,t){super(e,t),this.checkProps(e)}UNSAFE_componentWillReceiveProps(e){this.checkProps(e)}componentWillUnmount(){this.cancellation.cancelAll()}checkProps(e){if(h(e)===f(e))throw new Error("Property iri xor selection of mp-ldp-export-resource should be set")}getLDPService(){return new p.LdpService("",this.context.semanticContext)}onClick=()=>{const e=h(this.props)?[this.props.iri]:this.props.selection,t=l.getAbsoluteUrl(this.getLDPService().getExportURL(e)),{repository:r}=this.context.semanticContext;this.cancellation.map((0,d.getLabels)(e.map(u.Rdf.iri),{context:{repository:r}})).observe({value:e=>{const r=e.reduce((e,t)=>{const r=t.replace(/\s/g,"-");return""===e?r:`${e}-${r}`},""),o=`${s().format("YYYY-MM-DDTHH-mm")}-${window.location.hostname}-${r}.trig`;window.open(`${t}&filename=${o}`,"_blank")},error:e=>{console.error(e)}})};render(){const e=n.Children.only(this.props.children);return(0,n.cloneElement)(e,i({},e.props,{disabled:f(this.props)&&0===this.props.selection.length,onClick:this.onClick}))}}t.ExportResource=R,t.default=R}}]);

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.