Skip to content

Commit

Permalink
update example nanopub URL to use w3id.org instead of purl.org
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Mar 13, 2024
1 parent 375f260 commit 6190d75
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions display-react/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function App() {
return (
<div>
<h1>Nanopub Display React development</h1>
<NanopubDisplayReact url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />
{/* <nanopub-display url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" /> */}
<NanopubDisplayReact url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />
{/* <nanopub-display url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" /> */}
</div>
)
}
Expand Down
10 changes: 5 additions & 5 deletions nanopub-display/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ If you want to improve this library, please refer to the [contribute page](/page
<body>
<div style="min-height: 100vh; width: 100%;">
<div>
<nanopub-status url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />
<nanopub-status url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />
</div>
<nanopub-display url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />
<nanopub-display url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />
</div>
</body>
</html>
Expand All @@ -31,9 +31,9 @@ If you want to improve this library, please refer to the [contribute page](/page
> `<nanopub-display>` enables developers and users to control which graphs from the nanopublication are displayed.
<div>
<nanopub-status url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />
<nanopub-status url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />
</div>
<nanopub-display url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU"></nanopub-display>
<nanopub-display url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU"></nanopub-display>

## 💫 Declarative rendering

Expand All @@ -43,7 +43,7 @@ If you want to improve this library, please refer to the [contribute page](/page
import {html, render} from 'lit-html'
import '@nanopub/display'

const np = 'https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU'
const np = 'https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU'

render(
html`
Expand Down
4 changes: 2 additions & 2 deletions nanopub-display/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
</head>

<!-- url="https://purl.org/np/RAnZpSHgsLMH4mlgjGg9z6eN6dVI8BuudYX3jeyYKY1Fg" -->
<!-- url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" -->
<!-- url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" -->
<body>
<div style="min-height: 100vh; width: 100%">
<div>
<nanopub-status url="https://purl.org/np/RAnZpSHgsLMH4mlgjGg9z6eN6dVI8BuudYX3jeyYKY1Fg" />
</div>
<nanopub-display url="https://purl.org/np/RAnZpSHgsLMH4mlgjGg9z6eN6dVI8BuudYX3jeyYKY1Fg" id="display" />
<!-- <nanopub-display rdf="<http://np/#assertion> {<https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU> <http://ss> <http://zz>}" /> -->
<!-- <nanopub-display rdf="<http://np/#assertion> {<https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU> <http://ss> <http://zz>}" /> -->
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions nanopub-display/src/test/nanopub-display.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.describe('custom element adds "NEWLYADDED" when clicked', async () => {
<script src="/dist/nanopub-display.js"></script>
</head>
<body>
<${CUSTOM_ELEMENT_TAG} url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" id="display" />
<${CUSTOM_ELEMENT_TAG} url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" id="display" />
</body>
<script>
</script>
Expand Down Expand Up @@ -114,7 +114,7 @@ test.describe('custom element adds "NEWLYADDED" when clicked', async () => {

// beforeEach(async () => {
// document.body.innerHTML =
// '<nanopub-display url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />'
// '<nanopub-display url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />'
// await new Promise<void>(resolve => {
// const interval = setInterval(() => {
// if (getDisplay()) {
Expand Down
4 changes: 2 additions & 2 deletions nanopub-display/src/test/nanopub-display_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ suite('nanopub-display', () => {

test('render and check loading with a nanopub URL', async () => {
const el = await fixture(
html`<nanopub-display url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />`
html`<nanopub-display url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU" />`
)
// console.log(assert.shadowDom);
assert.shadowDom.equal(
Expand All @@ -28,7 +28,7 @@ suite('nanopub-display', () => {
})

// test('render and wait', async () => {
// const el = await fixture(html`<nanopub-display url="https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU"></nanopub-display>`);
// const el = await fixture(html`<nanopub-display url="https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU"></nanopub-display>`);
// assert.shadowDom.equal(
// el,
// `
Expand Down
8 changes: 4 additions & 4 deletions nanopub-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ You can easily import `@nanopub/utils` from a npm CDN and use it in your HTML pa
<script type="module">
const {getUpdateStatus, Nanopub} = NanopubUtils
const np = await Nanopub.fetch('https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU')
const np = await Nanopub.fetch('https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU')
console.log('Parsed nanopub:', np)
const status = await getUpdateStatus('https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU')
const status = await getUpdateStatus('https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU')
console.log(status)
</script>
</html>
Expand All @@ -32,7 +32,7 @@ You can instantiate the `Nanopub` object using various approaches:
```typescript
import {Nanopub} from '@nanopub/utils'

const np = await Nanopub.fetch('https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU')
const np = await Nanopub.fetch('https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU')
```

- **Parse** a RDF string in TRiG format:
Expand Down Expand Up @@ -153,7 +153,7 @@ Then import it in your JavaScript/TypeScript:
```typescript
import {Nanopub} from '@nanopub/utils'

const np = await Nanopub.fetch('https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU')
const np = await Nanopub.fetch('https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU')
```

## 🌐 Import from a CDN
Expand Down
2 changes: 1 addition & 1 deletion nanopub-utils/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>Check the console</h1>
<script type="module">
import {getJson, getLatestNp, getUpdateStatus, Nanopub} from './src/index.ts'

const npUrl = 'https://purl.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU'
const npUrl = 'https://w3id.org/np/RAHtkscyyyJDLvWRuINckQrn5rbHzQKvwakNVC3fmRzGU'

// Get status with await
const status = await getUpdateStatus(npUrl)
Expand Down

0 comments on commit 6190d75

Please sign in to comment.