diff --git a/nanopub-display/src/nanopub-display.ts b/nanopub-display/src/nanopub-display.ts index 6c8e67c..828fbb3 100644 --- a/nanopub-display/src/nanopub-display.ts +++ b/nanopub-display/src/nanopub-display.ts @@ -211,8 +211,8 @@ export class NanopubDisplay extends LitElement { super.connectedCallback() // const np = new Nanopub({url: this.url}) - const np = await Nanopub.fetch(this.url) - console.log(np.display()) + // const np = await Nanopub.fetch(this.url) + // console.log(np.display()) if (!this.url && !this.rdf) { this.error = `⚠️ No nanopublication has been provided, use the "url" or "rdf" @@ -220,11 +220,13 @@ export class NanopubDisplay extends LitElement { } if (!this.error && this.url && !this.rdf) { - if (this.url.startsWith('https://purl.org/np/') && !this.url.endsWith('.trig')) { - this.url = this.url + '.trig' - } + // if (this.url.startsWith('https://purl.org/np/') && !this.url.endsWith('.trig')) { + // this.url = this.url.replace('https://purl.org/np/', 'https://w3id.org/np/') // + '.trig' + // } try { - const response = await fetch(this.url) + const response = await fetch(this.url, { + headers: {Accept: 'application/trig'} + }) this.rdf = await response.text() } catch (error) { this.error = `⚠️ Issue fetching the nanopublication RDF at ${this.url}. ${error}` diff --git a/nanopub-utils/src/lib/nanopub-utils.ts b/nanopub-utils/src/lib/nanopub-utils.ts index 9714b63..2e925e0 100644 --- a/nanopub-utils/src/lib/nanopub-utils.ts +++ b/nanopub-utils/src/lib/nanopub-utils.ts @@ -15,9 +15,9 @@ export interface NpStatus { * Get update status for a nanopub URI in one of the APIs */ export const getUpdateStatus = async (npUri: string): Promise => { - if (npUri.startsWith('https://purl.org/np/')) { + if (npUri.startsWith('https://')) { // Quick fix as the URIs use http in the triplestore, but users might use the https version of the URI - npUri = npUri.replace('https://purl.org/np/', 'http://purl.org/np/') + npUri = npUri.replace('https://', 'http://') } const shuffledApiUrls = [...grlcNpApiUrls].sort(() => 0.5 - Math.random()) return getUpdateStatusX(npUri, shuffledApiUrls)