diff --git a/README.md b/README.md index add34e6..d5fe3ce 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The extracted entities and relations are then displayed to the users on the webs Backend built with [FastAPI](https://fastapi.tiangolo.com/), and [RDFLib](https://github.com/RDFLib/rdflib). -Frontend built with [Astro](https://astro.build/), [ReactJS](https://reactjs.org/), and [Material UI](https://mui.com/) +Frontend built with NextJS, [ReactJS](https://reactjs.org/), and [Material UI](https://mui.com/) ## 🌐 Public deployments diff --git a/astro-frontend/.dockerignore b/astro-frontend/.dockerignore deleted file mode 100644 index 0376209..0000000 --- a/astro-frontend/.dockerignore +++ /dev/null @@ -1,39 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# Create issue with next build and yarn 3 -yarn.lock - -# dependencies -/node_modules -/.pnp -.pnp.js -.yarn -.next -# .yarnrc.yml - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts diff --git a/astro-frontend/Dockerfile b/astro-frontend/Dockerfile deleted file mode 100644 index 156dc8d..0000000 --- a/astro-frontend/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ - -FROM node:18-alpine AS builder - -RUN apk add --no-cache libc6-compat git -WORKDIR /app - -COPY package.json yarn.lock* ./ -# RUN yarn --frozen-lockfile -RUN yarn - -ARG FRONTEND_URL -ARG API_URL -ENV PUBLIC_SITE_URL=$FRONTEND_URL -ENV PUBLIC_API_URL=$API_URL -ENV NODE_ENV production - -COPY . . - -RUN yarn build - -# In case someone want to use this stage for development -CMD ["yarn", "dev"] - - - -FROM nginx:stable-alpine -COPY --from=builder /app/dist /usr/share/nginx/html - -RUN sed -i "s/80;/4000;/g" /etc/nginx/conf.d/default.conf -EXPOSE 4000 - -CMD ["nginx", "-g", "daemon off;"] diff --git a/astro-frontend/README.md b/astro-frontend/README.md deleted file mode 100644 index 74d6962..0000000 --- a/astro-frontend/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# 🌐 Knowledge Collaboratory frontend - -[![Deploy frontend to GitHub Pages](https://github.com/MaastrichtU-IDS/knowledge-collaboratory/actions/workflows/deploy-frontend.yml/badge.svg)](https://github.com/MaastrichtU-IDS/knowledge-collaboratory/actions/workflows/deploy-frontend.yml) - -🔗 Deployed at [**maastrichtu-ids.github.io/knowledge-collaboratory**](https://maastrichtu-ids.github.io/knowledge-collaboratory) - -Built with [Astro](https://astro.build/), [ReactJS](https://reactjs.org/), and [Material UI for react](https://mui.com/). - -## 🧑‍💻 Development - -⚠️ All commands needs to be run from the `frontend/` directory. - -Install dependencies: - -```bash -yarn -``` - -Run the app in development: - -```bash -yarn dev -``` - -> Open [localhost:3000](http://localhost:3000) with your browser to see the result. The page auto-updates as you edit the file. - -## ✔️ Formatting - -Automatically format the code with `prettier`: - -```bash -yarn fmt -``` - -Run `eslint` to check for issues in the code: - -```bash -yarn lint -``` - -## 🚀 Production deployment - -🤖 There is a GitHub Action workflow to automatically build and deploy the website to GitHub Pages - -Build it locally, generating static pages in `dist/`: - -```bash -yarn build -``` - -Preview built website: - -```bash -yarn preview -``` - -🐳 Build and run with docker, served using nginx: - -```bash -docker build -t kc . -docker run -p 4000:4000 kc -``` - -## 🧞 Commands - -All commands are run from the root of the project, from a terminal: - -| Command | Action | -| :------------------ | :--------------------------------------------------- | -| `yarn` | Installs dependencies | -| `yarn dev` | Starts local dev server at `localhost:3000` | -| `yarn build` | Build your production site to `./dist/` | -| `yarn preview` | Preview your build locally, before deploying | -| `yarn format` | Format the code with `prettier` | -| `yarn lint` | Check for issues in the code with `eslint` | -| `yarn vscode` | Setup VSCode to properly resolve imports from yarn 3 | -| `yarn astro ...` | Run CLI commands like `astro add`, `astro check` | -| `yarn astro --help` | Get help using the Astro CLI | - -## 👀 Want to learn more? - -Feel free to check [Astro documentation](https://docs.astro.build) or jump into their [Discord server](https://astro.build/chat). - -Astro + Tailwind template: https://github.com/onwidget/astrowind - - diff --git a/astro-frontend/astro.config.mjs b/astro-frontend/astro.config.mjs deleted file mode 100644 index f4da01e..0000000 --- a/astro-frontend/astro.config.mjs +++ /dev/null @@ -1,63 +0,0 @@ -import {defineConfig} from 'astro/config'; -import react from '@astrojs/react'; -import image from '@astrojs/image'; -import AstroPWA from '@vite-pwa/astro' -// import serviceWorker from 'astrojs-service-worker'; -// import tailwind from "@astrojs/tailwind"; - -// https://astro.build/config -export default defineConfig({ - site: process.env.PUBLIC_SITE_URL || 'https://maastrichtu-ids.github.io', - base: process.env.PUBLIC_BASE_URL || '', - trailingSlash: 'ignore', - integrations: [ - react(), - image(), - // serviceWorker() - AstroPWA({ - mode: 'development', - base: '/', - scope: '/', - includeAssets: ['icon.png'], - manifest: { - name: 'Knowledge Collaboratory', - short_name: 'Knowledge Collaboratory', - theme_color: '#ffffff', - icons: [ - { - src: 'icon-192x192.png', - sizes: '192x192', - type: 'image/png', - }, - { - src: 'icon-512x512.png', - sizes: '512x512', - type: 'image/png', - }, - { - src: 'icon-512x512.png', - sizes: '512x512', - type: 'image/png', - purpose: 'any maskable', - }, - ], - }, - workbox: { - navigateFallback: '/index.html', - // navigateFallback: '/404', - globPatterns: ['**/*.{css,js,html,svg,png,ico,txt}'], - }, - devOptions: { - enabled: true, - navigateFallbackAllowlist: [/^index.html$/] - // navigateFallbackAllowlist: [/^\/404$/], - }, - }) - // tailwind({ - // config: { - // applyBaseStyles: false, - // }, - // }), - ], - output: 'static' -}); diff --git a/astro-frontend/package.json b/astro-frontend/package.json deleted file mode 100644 index 7ba3b03..0000000 --- a/astro-frontend/package.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "name": "knowledge-collaboratory", - "type": "module", - "version": "0.0.1", - "license": "MIT", - "private":true, - "scripts": { - "dev": "astro dev", - "dev:local": "PUBLIC_API_URL=http://localhost:8000 astro dev", - "dev:gh": "PUBLIC_BASE_URL=/knowledge-collaboratory astro dev", - "build": "astro build", - "build:gh": "PUBLIC_BASE_URL=/knowledge-collaboratory astro build", - "preview": "astro preview", - "vscode": "yarn dlx @yarnpkg/sdks vscode", - "fmt": "prettier --write . --ignore-path .gitignore", - "lint": "prettier --check . --ignore-path .gitignore && eslint --ignore-path .gitignore .", - "astro": "astro" - }, - "dependencies": { - "@astrojs/image": "^0.16.0", - "@astrojs/react": "^2.1.0", - "@astrojs/tailwind": "^3.1.0", - "@emotion/react": "^11.4.1", - "@emotion/styled": "^11.3.0", - "@fluentui/react": "^8.68.0", - "@fontsource/open-sans": "^4.5.14", - "@fontsource/roboto": "^4.5.8", - "@mui/material": "^5.11.10", - "@nanostores/react": "^0.4.1", - "@rjsf/core": "^4.2.0", - "@rjsf/fluent-ui": "^4.2.0", - "astro": "^2.1.0", - "astrojs-service-worker": "^0.0.9", - "axios": "^1.3.4", - "cytoscape": "^3.23.0", - "cytoscape-cola": "^2.5.0", - "cytoscape-cose-bilkent": "^4.1.0", - "cytoscape-dagre": "^2.4.0", - "cytoscape-euler": "^1.2.2", - "cytoscape-fcose": "^2.1.0", - "cytoscape-popper": "^2.0.0", - "cytoscape-spread": "^3.0.0", - "highlight.js": "^11.2.0", - "n3": "^1.16.3", - "nanopub-display": "git+https://github.com/vemonet/nanopub-display.git", - "nanostores": "^0.7.4", - "prop-types": "^15.8.1", - "react": "^18.0.0", - "react-dom": "^18.0.0", - "react-is": "^18.2.0", - "react-simple-oauth2-login": "^0.5.1", - "tailwindcss": "^3.0.24" - }, - "devDependencies": { - "@tailwindcss/typography": "^0.5.9", - "@types/cytoscape": "^3.19.9", - "@types/cytoscape-dagre": "^2.3.0", - "@types/cytoscape-euler": "^1.2.0", - "@types/cytoscape-fcose": "^2.1.1", - "@types/cytoscape-popper": "^2.0.0", - "@types/n3": "^1.10.4", - "@types/node": "18.14.1", - "@types/react": "^18.0.21", - "@types/react-dom": "^18.0.6", - "@typescript-eslint/eslint-plugin": "latest", - "@typescript-eslint/parser": "latest", - "@vite-pwa/astro": "^0.0.5", - "eslint": "^8.36.0", - "eslint-plugin-astro": "^0.24.0", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-react": "latest", - "prettier": "^2.8.4", - "prettier-plugin-astro": "^0.8.0" - }, - "prettier": { - "trailingComma": "none", - "tabWidth": 2, - "singleQuote": true, - "bracketSpacing": false, - "arrowParens": "avoid", - "useTabs": false, - "printWidth": 120, - "pluginSearchDirs": [ - "." - ] - }, - "eslintConfig": { - "env": { - "browser": true, - "es2021": true - }, - "extends": [ - "plugin:astro/recommended", - "plugin:react/recommended", - "plugin:@typescript-eslint/recommended" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "react", - "@typescript-eslint" - ], - "rules": {}, - "overrides": [ - { - "files": [ - "*.astro" - ], - "parser": "astro-eslint-parser", - "parserOptions": { - "parser": "@typescript-eslint/parser", - "extraFileExtensions": [ - ".astro" - ] - } - } - ], - "ignorePatterns": [ - "*.lock" - ] - } -} diff --git a/astro-frontend/public/favicon.svg b/astro-frontend/public/favicon.svg deleted file mode 100644 index 0f39062..0000000 --- a/astro-frontend/public/favicon.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/astro-frontend/public/github.svg b/astro-frontend/public/github.svg deleted file mode 100644 index af1538f..0000000 --- a/astro-frontend/public/github.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/astro-frontend/public/icon-192x192.png b/astro-frontend/public/icon-192x192.png deleted file mode 100644 index a1d4ada..0000000 Binary files a/astro-frontend/public/icon-192x192.png and /dev/null differ diff --git a/astro-frontend/public/icon-512x512.png b/astro-frontend/public/icon-512x512.png deleted file mode 100644 index 06ca562..0000000 Binary files a/astro-frontend/public/icon-512x512.png and /dev/null differ diff --git a/astro-frontend/public/icon.png b/astro-frontend/public/icon.png deleted file mode 100644 index 22bae9d..0000000 Binary files a/astro-frontend/public/icon.png and /dev/null differ diff --git a/astro-frontend/public/openapi_logo.svg b/astro-frontend/public/openapi_logo.svg deleted file mode 100644 index 0e277b2..0000000 --- a/astro-frontend/public/openapi_logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/astro-frontend/public/orcid_logo.svg b/astro-frontend/public/orcid_logo.svg deleted file mode 100644 index 65002fc..0000000 --- a/astro-frontend/public/orcid_logo.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - Orcid logo - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/astro-frontend/public/robots.txt b/astro-frontend/public/robots.txt deleted file mode 100644 index 7f4904e..0000000 --- a/astro-frontend/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Allow: / \ No newline at end of file diff --git a/astro-frontend/public/um_logo.png b/astro-frontend/public/um_logo.png deleted file mode 100644 index 38f0a85..0000000 Binary files a/astro-frontend/public/um_logo.png and /dev/null differ diff --git a/astro-frontend/src/app/PageAnnotate.tsx b/astro-frontend/src/app/PageAnnotate.tsx deleted file mode 100644 index 463518b..0000000 --- a/astro-frontend/src/app/PageAnnotate.tsx +++ /dev/null @@ -1,1126 +0,0 @@ -'use client'; - -import React, {useContext} from 'react'; -import { - Typography, - Popper, - ClickAwayListener, - Paper, - Container, - Box, - CircularProgress, - Tooltip, - IconButton, - Button, - Card, - FormControl, - TextField, - Grid -} from '@mui/material'; -import axios from 'axios'; - -import {settings, genericContext} from '../utils/settings'; -import {context, propertiesList, predicatesList, sentenceToAnnotate, ents} from '../utils/biolinkModel'; -import PublishNanopubButtons from '../components/PublishNanopubButtons'; -import {FormSettings} from '../components/StyledComponents'; -import AutocompleteEntity from '../components/AutocompleteEntity'; -import DropdownButton from '../components/DropdownButton'; -import Taggy from '../components/ReactTaggy'; -import PubAnnotationProjects from '../components/PubAnnotationProjects'; -import Icon from '../components/Icon'; -import {useStore} from '@nanostores/react'; -import {userProfile} from '../utils/nanostores'; - -// Define namespaces for building RDF URIs -const BIOLINK = 'https://w3id.org/biolink/vocab/'; -const IDO = 'https://identifiers.org/'; - -const curieToUri = (curie: string) => { - const namespace = curie.substring(0, curie.indexOf(':')); - if (context[namespace]) { - return context[namespace] + curie.substring(curie.indexOf(':') + 1); - } - return IDO + curie; -}; - -const defaultPrompt = `From the text below, extract the entities, classify them and extract associations between those entities -Entities to extract should be of one of those types: "Chemical Entity", "Disease", "Gene", "Gene Product", "Organism Taxon" - -Return the results as a YAML object with the following fields: -- entities: -- associations: `; - -export default function PageAnnotate() { - const $userProfile = useStore(userProfile); - - // useLocation hook to get URL params - // let location = useLocation(); - const tagSelected: any = null; - const [state, setState] = React.useState({ - pubAnnotationProjects: [], - // inputText: 'Amantadine hydrochloride capsules are indicated in the treatment of idiopathic Parkinson’s disease (Paralysis Agitans), postencephalitic parkinsonism and symptomatic parkinsonism which may follow injury to the nervous system by carbon monoxide intoxication.', - inputText: '', - inputSource: '', - inputDocument: '', - inputProject: '', - editInputText: '', - editPrompt: defaultPrompt, - extractionModel: 'litcoin', // LitCoin 1, OpenAI 0 - templateSelected: 'RDF reified statements', - extractClicked: false, - entitiesList: [], - // externalEntities: [], - tagSelected: tagSelected, - statements: [{s: '', p: '', o: '', props: []}], - loading: false, - nanopubGenerated: false, - nanopubPublished: false, - errorMessage: '' - }); - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - // Settings for Popper - const [open, setOpen] = React.useState(false); - const [anchorEl, setAnchorEl]: any = React.useState(null); - const handleClickAway = () => { - setOpen(false); - setAnchorEl(anchorEl ? null : anchorEl); - }; - - React.useEffect(() => { - // const params = new URLSearchParams(location.search + location.hash); - // let sentences_url = params.get('sentences'); - // Get a random sentence to annotate - if (!state.inputText) { - const randomSentence = sentenceToAnnotate[Math.floor(Math.random() * sentenceToAnnotate.length)]; - updateState({ - inputText: randomSentence.text, - editInputText: randomSentence.text, - inputSource: randomSentence.url - }); - } - - // Get projects: http://pubannotation.org/projects.json - // Check a doc to annotate: http://pubannotation.org/projects/CyanoBase/docs/sourcedb/PubMed/sourceid/10903511 - // All docs for a sourcedb: http://pubannotation.org/projects/CyanoBase/docs/sourcedb/PubMed.json?page=2 - // All docs for a project: https://pubannotation.org/projects/CyanoBase/docs.json - // Need to be paginated - // In our annotations we want to record: - // - source pubmed URL - // - pubannotation URL (tao:part_of?) - // - maybe the project in which this annotation is done? - // The user can select one of the proposed PubAnnotation projects - // We query the SPARQL endpoint to get the list of annotations done for this project - // Count the number of annotations already published, divide this number by 10 (per page), - // go to the right page and take the next annotation - - // Later: the user can see the completion of the different projects (call /projects.json) - // Questions: - // Is it possible to increase the amount of rows per page? From the default 10 - // Is it possible to easily get the total count of documents in a project? - }, []); - - // Order is important, litcoin needs to be last for the dropdown - const extractionOptions = [ - 'Extract entities with OpenAI GPT-3.5 turbo', - 'Extract entities with OpenAI GPT-3 text-davinci-003', - 'Extract entities with OpenAI GPT-3 code-davinci-002', - 'Extract entities with the LitCoin model' - ]; - const extractionIds = ['gpt-3.5-turbo', 'text-davinci-003', 'code-davinci-002', 'litcoin']; - // "drug.DrugMechanism": "OntoGPT drug.DrugMechanism", - // "ctd.ChemicalToDiseaseDocument": "OntoGPT ctd.ChemicalToDiseaseDocument", - // "drug.DrugMechanism": "OntoGPT drug.DrugMechanism", - // "biological_process.BiologicalProcess": "OntoGPT biological_process.BiologicalProcess", - // "gocam.GoCamAnnotations": "OntoGPT gocam.GoCamAnnotations", - // "treatment.DiseaseTreatmentSummary": "OntoGPT treatment.DiseaseTreatmentSummary", - // "reaction.ReactionDocument": "OntoGPT reaction.ReactionDocument", - - const extractOpenAI = () => { - axios - .post( - settings.apiUrl + '/openai-extract', - {text: state.editInputText}, - { - // headers: { Authorization: `Bearer ${$userProfile.access_token}` }, - params: { - prompt: state.editPrompt, - engine: state.extractionModel - } - } - ) - .then(async res => { - console.log('Object extracted by OpenAI', res.data); - const entities: any = []; - const statements: any = []; - // Prepare entities extracted, and retrieve their potential CURIEs with the SRI NameResolution API - await Promise.all( - res.data['entities'].map(async (extractedEntity: any, index: number) => { - const label = extractedEntity['label']; - const type = extractedEntity['type'] - .split(' ') - .map((word: any) => word.charAt(0).toUpperCase() + word.slice(1)) - .join(''); - const start = state.editInputText.toLowerCase().indexOf(label.toLowerCase()); - const end = start + label.length; - const ent: any = { - index: `${entities.length}:${start}:${end}:${label}`, - text: label, - token: label, - type: type, - start: start, - end: end - }; - const entityCuries: any = await getEntityCuries(label); - ent['curies'] = []; - if (entityCuries && Object.keys(entityCuries).length > 0) { - Object.keys(entityCuries).map((curie: any) => { - const addEnt: any = { - curie: curie, - label: entityCuries[curie][0], - altLabel: entityCuries[curie][1] - }; - ent['curies'].push(addEnt); - }); - ent['id_curie'] = ent['curies'][0]['curie']; - ent['id_label'] = ent['curies'][0]['label']; - ent['id_uri'] = curieToUri(ent['id_curie']); - } - entities.push(ent); - }) - ); - - try { - // Prepare statements extracted - // o: { index: "chorea:1:57:63", text: "chorea", type: "DiseaseOrPhenotypicFeature", … } - // p: { id: "https://w3id.org/biolink/vocab/treats", curie: "biolink:treats", label: "treats" } - // s: { index: "Tetrabenazine:0:0:13", text: "Tetrabenazine", type: "ChemicalEntity", … } - res.data['associations'].map((asso: any, index: number) => { - const pred = asso['predicate'].replaceAll(' ', '_'); - const stmt: any = { - p: { - id: BIOLINK + pred, - curie: 'biolink:' + pred, - label: pred - } - }; - entities.map((ent: any, index: number) => { - if (asso['subject'] == ent['text']) { - stmt['s'] = ent; - } - if (asso['object'] == ent['text']) { - stmt['o'] = ent; - } - }); - statements.push(stmt); - }); - } catch (err) { - console.log(`Error extracting statements: ${err}`); - } - // console.log("UPDATE STATE extract OpenAI", entities) - updateState({ - loading: false, - entitiesList: entities, - statements: statements, - extractClicked: true - }); - }) - .catch(error => { - console.log('Error while extracting entities', error); - let errMsg = `Error while extracting entities from the text.\nPlease retry later, and feel free to create an issue on our GitHub repository if the issue persists.`; - if (error.response) { - errMsg = `Error while extracting entities from the text because ${error.response.data.detail}.\nPlease retry later, and feel free to create an issue on our GitHub repository if the issue persists.`; - } - updateState({ - loading: false, - errorMessage: errMsg, - extractClicked: true - }); - }); - }; - - const handleExtract = (event: React.FormEvent) => { - if (event) { - event.preventDefault(); - } - updateState({ - loading: true, - errorMessage: '', - inputText: state.editInputText, - entitiesList: [], - statements: [], - nanopubGenerated: false, - nanopubPublished: false - }); - let extract_relations = true; - const maxLengthRelExtract = 1000; - if (state.editInputText.length > maxLengthRelExtract) { - // We don't extract relations if text too long - console.log( - `⚠️ Text is more than ${maxLengthRelExtract} characters, we will not extract relations with the LitCoin model (too long)` - ); - extract_relations = false; - } - if (state.extractionModel !== 'litcoin') { - extractOpenAI(); - } else { - // Extract with Litcoin model - axios - .post( - settings.apiUrl + '/get-entities-relations', - {text: state.editInputText}, - {params: {extract_relations: extract_relations}} - ) - .then(res => { - updateState({ - loading: false, - entitiesList: res.data.entities, - extractClicked: true - }); - if (res.data.statements) { - updateState({ - statements: res.data.statements - }); - } - // console.log("LITCOIN model returns", res.data) - }) - .catch(error => { - updateState({ - loading: false, - errorMessage: `Error while extracting entities from the text because ${error.response.data.detail}.\nPlease retry later, and feel free to create an issue on our GitHub repository if the issue persists.`, - extractClicked: true - }); - }); - } - }; - - const getPropValue = (prop: any) => { - if (prop['id_uri']) { - return prop.id_uri; - } - if (prop['id']) { - return prop.id; - } - if (prop['text']) { - return prop.text; - } - return prop; - }; - const checkIfUri = (text: string) => { - return /^https?:\/\/[-_\/#:\?=\+%\.0-9a-zA-Z]+$/i.test(text); - }; - // const getUri = (prop: any) => { - // if (prop['id_uri']) return prop.id_uri - // if (prop['id']) return prop.id - // return prop - // } - - // Main function to generate JSON-LD RDF from the statements and entities provided through the tool - const generateRDF = () => { - const stmtJsonld: any = []; - const taoAnnotations: any = []; - - if (state.templateSelected === 'RDF reified statements') { - stmtJsonld.push({ - '@id': 'https://w3id.org/biolink/infores/knowledge-collaboratory', - '@type': 'biolink:InformationResource', - 'biolink:category': 'biolink:InformationResource', - 'biolink:id': 'infores:knowledge-collaboratory' - }); - state.statements.map((stmt: any, index: number) => { - // console.log("Iterating state.statements for generateRDF", stmt) - // Generate spo statement - const reifiedStmt: any = { - [`@type`]: 'biolink:Association', - 'biolink:category': 'biolink:Association', - 'rdf:subject': {'@id': getPropValue(stmt.s)}, - 'rdf:predicate': {'@id': getPropValue(stmt.p)}, - 'rdf:object': {'@id': getPropValue(stmt.o)}, - // "rdf:subject": {'@id': stmt.s.id_curie}, - // "rdf:predicate": {'@id': stmt.p.curie}, - // "rdf:object": {'@id': stmt.o.id_curie}, - 'biolink:id': `collaboratory:${stmt.s.id_curie}-${stmt.p.curie}-${stmt.o.id_curie}`, - 'biolink:aggregator_knowledge_source': {'@id': 'infores:knowledge-collaboratory'} - }; - if (state.inputSource) { - reifiedStmt[BIOLINK + 'publications'] = {'@id': state.inputSource}; - stmtJsonld.push({ - '@id': state.inputSource, - '@type': 'biolink:Publication', - 'biolink:category': 'biolink:Publication', - 'biolink:id': state.inputSource - }); - } - // Add props to the statement - if (stmt.props) { - stmt.props.map((prop: any, pindex: number) => { - const addProp = getPropValue(prop.p); - const addValue = getPropValue(prop.o); - if (addProp && addValue) { - if (!reifiedStmt[addProp]) { - reifiedStmt[addProp] = []; - } - if (checkIfUri(addValue)) { - reifiedStmt[addProp].push({'@id': addValue}); - } else { - reifiedStmt[addProp].push(addValue); - } - } - }); - } - stmtJsonld.push(reifiedStmt); - }); - } else { - // If Plain RDF mode enabled (disabled atm) - state.statements.map((stmt: any) => { - stmtJsonld.push({ - '@id': getPropValue(stmt.s), - [getPropValue(stmt.p)]: getPropValue(stmt.o) - }); - }); - } - - const docUri = state.inputDocument ? state.inputDocument : 'http://purl.org/nanopub/temp/np#document'; - const taoDoc: any = { - '@id': docUri, - '@type': 'tao:document_text', - 'tao:has_value': state.inputText - }; - if (state.inputSource) { - taoDoc['rdfs:seeAlso'] = {'@id': state.inputSource}; - } - if (state.inputProject) { - taoDoc['tao:part_of'] = {'@id': state.inputProject}; - } - taoAnnotations.push(taoDoc); - - // Generate triples for the entities - state.entitiesList.map((entity: any) => { - if (entity.id_uri && entity.type) { - const entityJsonld: any = { - '@id': entity.id_uri, - '@type': `biolink:${entity.type}`, - 'biolink:id': entity.id_curie, - 'biolink:category': `biolink:${entity.type}`, - 'rdfs:label': entity.text - }; - taoAnnotations.push({ - '@type': 'tao:text_span', - 'tao:begins_at': entity.start, - 'tao:ends_at': entity.end, - 'tao:has_value': entity.text, - 'tao:denotes': {'@id': entity.id_uri}, - 'tao:part_of': {'@id': docUri} - }); - // Generate the props of the entity - if (entity.props) { - entity.props.map((prop: any, pindex: number) => { - const addProp = getPropValue(prop.p); - const addValue = getPropValue(prop.o); - if (addProp && addValue) { - if (!entityJsonld[addProp]) { - entityJsonld[addProp] = []; - } - if (checkIfUri(addValue)) { - // Quick check if URI - entityJsonld[addProp].push({'@id': addValue}); - } else { - entityJsonld[addProp].push(addValue); - } - } - }); - } - stmtJsonld.push(entityJsonld); - } - }); - return { - '@context': genericContext, - '@graph': stmtJsonld, - '@provenance': { - '@context': { - tao: 'http://pubannotation.org/ontology/tao.owl#', - rdfs: 'http://www.w3.org/2000/01/rdf-schema#' - }, - '@graph': taoAnnotations - } - }; - }; - - const handleTextChange = (event: React.ChangeEvent) => { - updateState({[event.target.id]: event.target.value}); - }; - - const addStatement = (event: React.FormEvent) => { - event.preventDefault(); - const stmts: any = state.statements; - stmts.push({s: '', p: '', o: '', props: []}); - updateState({statements: stmts}); - }; - const addProperty = (event: React.FormEvent) => { - // event.preventDefault(); - const stmts: any = state.statements; - // @ts-ignore - const stmtIndex = event.target.id.split('-')[0].split(':')[1]; - if (!stmts[stmtIndex]['props']) { - stmts[stmtIndex]['props'] = []; - } - stmts[stmtIndex]['props'].push({p: '', o: ''}); - updateState({statements: stmts}); - }; - - const handleRemoveStmt = (index: number) => { - // TODO: entities that are not anymore relevant are removed when a statement is removed - const stmts = state.statements; - stmts.splice(index, 1); - updateState({statements: stmts}); - }; - - const addEntityProperty = (event: React.FormEvent, editEnt: any) => { - // event.preventDefault(); - const entitiesList: any = state.entitiesList; - if (!editEnt['props']) { - editEnt['props'] = []; - } - editEnt['props'].push({p: '', o: ''}); - const entityIndex = entitiesList.findIndex((ent: any) => ent.index === editEnt.index); - entitiesList[entityIndex] = editEnt; - updateState({entitiesList: entitiesList, tagSelected: editEnt}); - }; - const handleRemoveEntity = (index: any) => { - const entitiesList = state.entitiesList; - // Delete the entity with the same index - entitiesList.splice( - entitiesList.findIndex((ent: any) => ent.index === index), - 1 - ); - updateState({entitiesList: entitiesList, tagSelected: null}); - handleClickAway(); - }; - const handleRemoveProp = (stmtIndex: number, pindex: number) => { - const stmts = state.statements; - stmts[stmtIndex].props.splice(pindex, 1); - updateState({statements: stmts}); - }; - const handleRemoveEntityProp = (editEnt: any, pindex: number) => { - const entitiesList: any = state.entitiesList; - editEnt.props.splice(pindex, 1); - // editEnt.props.splice(entitiesList.findIndex((ent: any) => ent.index === editEnt.index), 1); - const entityIndex = entitiesList.findIndex((ent: any) => ent.index === editEnt.index); - entitiesList[entityIndex] = editEnt; - updateState({entitiesList: entitiesList, tagSelected: editEnt}); - }; - - const clickTag = (event: any, tag: any, elemIndex: any) => { - setAnchorEl(anchorEl ? null : event.currentTarget); - setOpen(prev => !prev); - updateState({tagSelected: tag}); - }; - - const getEntityCuries = async (text: string) => { - const data = await axios - .post( - 'https://name-resolution-sri.renci.org/lookup', - {}, - { - params: { - string: text, - offset: 0, - limit: 30 - } - } - ) - .then(res => { - return res.data; - }) - .catch(error => { - console.log(error); - return null; - }); - return data; - }; - - const highlightCallback = async (event: any, text: string, spanIndex: number, start: number, end: number) => { - const entIndex = `${text}:${spanIndex}:${start}:${end}`; - setAnchorEl(anchorEl ? null : event.currentTarget); - setOpen(prev => !prev); - if (text.length > 1 && state.entitiesList.findIndex((ent: any) => ent.index === entIndex) === -1) { - const curies: any = []; - const newEntity = { - index: entIndex, - text: text, - token: text, - type: 'NamedEntity', - start: start, - end: end, - curies: curies, - id_curie: '', - id_label: '', - id_uri: '', - props: [] - }; - const entityCuries = await getEntityCuries(text); - if (entityCuries && Object.keys(entityCuries).length > 0) { - Object.keys(entityCuries).map((curie: any) => { - const addEnt: any = { - curie: curie, - label: entityCuries[curie][0], - altLabel: entityCuries[curie][1] - }; - newEntity['curies'].push(addEnt); - }); - newEntity['id_curie'] = Object.keys(entityCuries)[0]; - newEntity['id_label'] = entityCuries[newEntity['id_curie']][0]; - newEntity['id_uri'] = curieToUri(newEntity['id_curie']); - } - if (state.entitiesList.findIndex((ent: any) => ent.index === entIndex) == -1) { - const entitiesList: any = state.entitiesList; - entitiesList.push(newEntity); - updateState({tagSelected: newEntity, entitiesList: entitiesList}); - } - } - }; - - const addToStatements = (property: string, newInputValue: any, index: any, pindex: any = null) => { - const stmts: any = state.statements; - if (newInputValue) { - if (pindex == null) { - if (typeof newInputValue === 'object' || checkIfUri(newInputValue)) { - stmts[index][property] = newInputValue as string; - } - } else { - if (typeof newInputValue === 'object' || checkIfUri(newInputValue)) { - stmts[index]['props'][pindex][property] = newInputValue as string; - } - } - } - updateState({statements: stmts}); - }; - - return ( - -

🏷️ Annotate biomedical text

-

- This service uses extraction models to help you annotate biomedical text using the{' '} - - BioLink model - - , and standard identifiers resolved using the{' '} - - NIH NCATS Translator SRI Name Resolution API - - , such as MONDO and PubChem. The annotations are represented with the{' '} - - RDF - {' '} - standard, using the{' '} - - TAO ontology - - , also used by the{' '} - - PubAnnotation - {' '} - service. Generated annotations can be downloaded in the{' '} - - JSON-LD - {' '} - format, or published as{' '} - - Nanopublications - {' '} - after login with your ORCID. -

- {/* - This service uses extraction models to help you annotate biomedical text using the BioLink model, and - standard identifiers resolved using the NIH NCATS Translator SRI Name Resolution API, such as MONDO and PubChem. - The annotations are represented with the RDF standard, using the TAO ontology, - also used by the PubAnnotation service. - Generated annotations can be downloaded in the JSON-LD format, or published as Nanopublications after login with your ORCID. - */} - {/* - 🪄 A machine learning model automatically extracts biomedical entities and relations from the given text, classify them in different types from the BioLink model (chemical, disease, etc), - and retrieve potential identifiers for those entities using the NIH NCATS Translator SRI Name Resolution API. - */} - - { - updateState({ - inputText: document.text, - editInputText: document.text, - inputSource: document.source_url, - inputDocument: document.target, - inputProject: document.project - }); - }} - /> - -
- - - - - - - - -
- , index: number) => { - updateState({extractionModel: extractionIds[index]}); - }} - onClick={(event: any) => { - handleExtract(event); - }} - // loggedIn={$userProfile.id} - /> -
- - {/* { !$userProfile.id && - - 🔒️ You need to login with your ORCID to use OpenAI models - - } */} - {state.extractionModel != 'litcoin' && ( - - )} -
-
- - {state.loading && ( - - - - )} - - {/* Card showing an entity when clicked on */} - - - - {state.tagSelected && ( - <> - - {state.tagSelected.token} - Delete the entity}> - handleRemoveEntity(state.tagSelected.index)} - style={{marginLeft: '8px', alignContent: 'right'}} - color="default" - > - - - - - (option.category ? option.category : null)} - style={{marginBottom: '16px'}} - onChange={(event: any, newInputValue: any) => { - const tagSelected: any = state.tagSelected; - if (newInputValue && newInputValue != tagSelected.type) { - const entitiesList: any = state.entitiesList; - const entityIndex = entitiesList.findIndex((ent: any) => ent.index === tagSelected.index); - entitiesList[entityIndex].type = newInputValue.type; - tagSelected.type = newInputValue.type; - updateState({tagSelected: tagSelected, entitiesList: entitiesList}); - } - }} - /> - `${option.label}${option.altLabel ? `, ${option.altLabel}` : ''} (${option.curie})`} - style={{marginBottom: '16px'}} - onChange={async (event: any, newInputValue: any) => { - // console.log('autocomplete entity newInputValue', newInputValue); - const entitiesList: any = state.entitiesList; - const tagSelected = state.tagSelected; - const entityIndex = entitiesList.findIndex((ent: any) => ent.index === tagSelected.index); - - if (newInputValue && (typeof newInputValue === 'object' || checkIfUri(newInputValue))) { - if (newInputValue.curie) { - entitiesList[entityIndex].id_curie = newInputValue.curie; - entitiesList[entityIndex].id_label = newInputValue.label; - entitiesList[entityIndex].id_uri = curieToUri(newInputValue.curie); - tagSelected.id_curie = newInputValue.curie; - tagSelected.id_label = newInputValue.label; - tagSelected.id_uri = curieToUri(newInputValue.curie); - } else { - delete entitiesList[entityIndex].id_curie; - delete entitiesList[entityIndex].id_label; - entitiesList[entityIndex].id_uri = newInputValue; - delete tagSelected.id_curie; - delete tagSelected.id_label; - tagSelected.id_uri = newInputValue; - } - updateState({tagSelected: tagSelected, entitiesList: entitiesList}); - } - - // If newInputValue is str len() > 2: we search in SRI API - // and update the "curies" options from the result for the autocomplete - if (newInputValue && typeof newInputValue === 'string' && newInputValue.length > 2) { - const entityCuries = await getEntityCuries(newInputValue); - if (entityCuries && Object.keys(entityCuries).length > 0) { - tagSelected.curies = []; - Object.keys(entityCuries).map((curie: any) => { - const addEnt: any = { - curie: curie, - label: entityCuries[curie][0], - altLabel: entityCuries[curie][1] - }; - tagSelected.curies.push(addEnt); - }); - updateState({tagSelected: tagSelected}); - } - } - }} - /> - {state.templateSelected !== 'Plain RDF' && - state.tagSelected.props && - state.tagSelected.props.map((prop: any, pindex: number) => { - return ( - - - -b.type[0].toUpperCase().localeCompare(a.type[0].toUpperCase()) - )} - onChange={(event: any, newInputValue: any) => { - // if (newInputValue && newInputValue != tagSelected.type) { - if (typeof newInputValue === 'object' || checkIfUri(newInputValue)) { - const entitiesList: any = state.entitiesList; - const tagSelected = state.tagSelected; - tagSelected.props[pindex]['p'] = newInputValue; - const entityIndex = entitiesList.findIndex((ent: any) => ent.index === pindex); - entitiesList[entityIndex] = tagSelected; - updateState({entitiesList: entitiesList, tagSelected: tagSelected}); - } - }} - /> - - - - { - if (typeof newInputValue === 'object' || checkIfUri(newInputValue)) { - const entitiesList: any = state.entitiesList; - const tagSelected = state.tagSelected; - tagSelected.props[pindex]['o'] = newInputValue; - const entityIndex = entitiesList.findIndex((ent: any) => ent.index === pindex); - entitiesList[entityIndex] = tagSelected; - updateState({entitiesList: entitiesList, tagSelected: tagSelected}); - } - }} - /> - - - Delete the statement}> - handleRemoveEntityProp(state.tagSelected, pindex)} - color="default" - > - - - - - - ); - })} - -
- -
- - )} -
-
-
- - {state.extractClicked && ( - <> - - 💡 You can edit entities by clicking on their tag, or add new entities by highlighting the text - corresponding to the entity. Potential identifiers are automatically retrieved for the highlighted text. - - - - - - {/* TODO: add button to add external entities not in the text? */} - {/* - { state.externalEntities.map((ent: any, index: number) => { - return - })} */} - - )} - - {state.entitiesList.length > 0 && ( - <> - - 2. Define the statements that represent the assertions made in the text, you can add properties to provide - more context: - - - {state.statements.map((stmtRow: any, index: number) => { - return ( - - - - { - addToStatements('s', newInputValue, index); - }} - validate="entity" - /> - - - - -b.type[0].toUpperCase().localeCompare(a.type[0].toUpperCase()) - )} - onChange={(event: any, newInputValue: any) => { - addToStatements('p', newInputValue, index); - }} - validate="entity" - /> - - - - { - addToStatements('o', newInputValue, index); - }} - validate="entity" - /> - - - - Delete the statement}> - handleRemoveStmt(index)} color="default"> - - - - - - {state.templateSelected !== 'Plain RDF' && - state.statements[index].props && - state.statements[index].props.map((prop: any, pindex: number): any => { - return ( - - - -b.type[0].toUpperCase().localeCompare(a.type[0].toUpperCase()) - )} - onChange={(event: any, newInputValue: any) => { - addToStatements('p', newInputValue, index, pindex); - }} - validate="entity" - /> - - - - { - addToStatements('o', newInputValue, index, pindex); - }} - validate="entity" - /> - - - Delete the statement}> - handleRemoveProp(index, pindex)} color="default"> - - - - - - ); - })} - {state.templateSelected !== 'Plain RDF' && ( -
- -
- )} -
- ); - })} - - - )} - - {state.extractClicked && ( - - )} -
- ); -} diff --git a/astro-frontend/src/app/PageBrowse.tsx b/astro-frontend/src/app/PageBrowse.tsx deleted file mode 100644 index 7ce323d..0000000 --- a/astro-frontend/src/app/PageBrowse.tsx +++ /dev/null @@ -1,408 +0,0 @@ -import React from 'react'; -import { - Typography, - Container, - CircularProgress, - TextField, - Box, - InputBase, - Paper, - IconButton, - Stack, - Autocomplete -} from '@mui/material'; -import axios from 'axios'; - -import {settings} from '../utils/settings'; -import {CytoscapeRdfGraph, rdfToCytoscape} from '../components/CytoscapeRdf'; -import DisplayNanopub from '../components/DisplayNanopub'; -import Icon from '../components/Icon'; - -export default function PageBrowse() { - const resourceTypesList: any = [ - {label: 'PREDICT reference dataset', uri: 'http://purl.org/np/RAWWaT9M_Nd8cVm_-amJErz60Ak__tkS6ROi2P-swdmMw'}, - { - label: 'Off-Label drug indication dataset', - uri: 'http://purl.org/np/RAaZp4akBZI6FuRzIpeksyYxTArOtxqmhuv9on-YssEzA' - }, - { - label: 'Claims published with Annotate biomedical text', - uri: 'https://w3id.org/biolink/infores/knowledge-collaboratory' - }, - {label: 'All nanopublications', uri: 'All nanopublications'} - ]; - const users_pubkeys: any = {}; - const nanopub_obj: any = {}; - const users_orcid: any = {}; - const filter_user: any = {}; - const filterPerResource: any = {}; - const [state, setState] = React.useState({ - open: false, - dialogOpen: false, - loading_nanopubs: false, - filter_user: filter_user, - filter_text: '', - search: '', - results_count: 10, - nanopub_list: [], - nanopub_obj: nanopub_obj, - prefixes: {}, - users_list: [], - users_pubkeys: users_pubkeys, - users_orcid: users_orcid, - filterPerResource: filterPerResource - }); - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - // const initNanopubObj: any = {} - const [nanopubObj, setNanopubObj] = React.useState([]); - - React.useEffect(() => { - // Get the edit URL param if provided - // const params = new URLSearchParams(location.search + location.hash); - // let searchText = params.get('search'); - // http://grlc.nanopubs.lod.labs.vu.nl/api/local/local/get_all_users - // Returns csv with columns: user, name, intronp, date, pubkey - updateState({ - loading_nanopubs: true - }); - - // First call to get users - axios - .get(settings.nanopubGrlcUrl + '/get_all_users', { - headers: { - accept: 'application/json' - } - }) - .then(res => { - const users_pubkeys: any = {}; - const users_orcid: any = {}; - const users_list = []; - for (const user of res.data['results']['bindings']) { - // Remove bad ORCID URLs - if (!user['user']['value'].startsWith('https://orcid.org/https://orcid.org/')) { - if (!user['name']) { - user['name'] = {value: user['user']['value']}; - } - users_pubkeys[user['pubkey']['value']] = user; - users_orcid[user['user']['value']] = user; - } - } - for (const user of Object.keys(users_orcid)) { - // users_pubkeys[user['pubkey']['value']] = user - // users_orcid[user['user']['value']] = user - users_list.push(users_orcid[user]); - } - // console.log(users_pubkeys); - updateState({ - users_list: users_list, - users_pubkeys: users_pubkeys, - users_orcid: users_orcid - }); - // console.log(res.data['results']['bindings']); - - getNanopubs(''); - }) - .catch(error => { - console.log(error); - }); - - // TODO: search for text with users pubkey with results in JSON - // http://grlc.nanopubs.lod.labs.vu.nl/api/local/local/find_valid_signed_nanopubs_with_text?pubkey=aaaa&text=covid - // curl -X GET "http://grlc.nanopubs.lod.labs.vu.nl/api/local/local/find_valid_signed_nanopubs_with_text?text=covid" -H "accept: application/json" - // { "head": { "link": [], "vars": ["np", "graphpred", "subj", "pred", "v", "date", "pubkey", "superseded", "retracted"] }, - // "results": { "distinct": false, "ordered": true, "bindings": [ - // { "np": { "type": "uri", "value": "http://purl.org/np/RAcp3CnDDmfxN9HAdeGMTTIZZtGknEhV2-BZrNX0i4cPA" } , "graphpred": { "type": "uri", "value": "http://www.nanopub.org/nschema#hasAssertion" } , "subj": { "type": "uri", "value": "http://purl.org/np/RAcp3CnDDmfxN9HAdeGMTTIZZtGknEhV2-BZrNX0i4cPA#EduSocDL" } , "pred": { "type": "uri", "value": "http://www.w3.org/2000/01/rdf-schema#label" } , "v": { "type": "typed-literal", "datatype": "http://www.w3.org/2001/XMLSchema#string", "value": "Data Linking across Social and Educational Sciences on COVID-19" } , "date": { "type": "typed-literal", "datatype": "http://www.w3.org/2001/XMLSchema#dateTime", "value": "2020-10-05T14:20:03.409Z" } , "pubkey": { "type": "typed-literal", "datatype": "http://www.w3.org/2001/XMLSchema#string", "value": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCK4NfUi+AdFS8l/WeyiKQmCyFyjrjfGnpHvUvdGUlkg2+FkOY3+31U4a4SdeLUdhf4hnxL8kQOjD8BuggdBkuwUoMA0RXPv+RblmlF5INhXDJvxTqeUMLj1EVuOtotpl//NVFZ3BE0zeuscT35szmX4L+2m14Z/PqreP2lMzbj3wIDAQAB" }}, - }, []); - - const getNanopubs = (search: string = '') => { - let get_nanopubs_url = settings.nanopubGrlcUrl + '/find_valid_signed_nanopubs?'; - const knowledgeProvider = 'https://w3id.org/biolink/infores/knowledge-collaboratory'; - const assertionBlocks = []; - const provBlocks = []; - - if (search) { - assertionBlocks.push(` ?association ?pred ?v . - FILTER(contains(lcase(str(?v)), lcase("${search}") ) )`); - // Using Virtuoso full text search (misses URIs): - // assertionBlocks.push(` { ?association ?pred ?v . ?v luc:npIdx "${search}" . } - // UNION - // { ?association ?pred ?v . ?v "${search}" . }`) - } - - let filterNpIndexBlock = ''; - if (state.filterPerResource && Object.keys(state.filterPerResource).length > 0) { - if (state.filterPerResource.uri === 'https://w3id.org/biolink/infores/knowledge-collaboratory') { - // Only claims published with the collaboratory tools - provBlocks.push(`?np_assertion prov:wasQuotedFrom ?wasQuotedFrom .`); - } else if (state.filterPerResource.uri !== 'All nanopublications') { - // assertionBlocks.push(`?association biolink:primary_knowledge_source <${state.filterPerResource.uri}> .`) - filterNpIndexBlock = `graph ?indexAssertionGraph { - { - <${state.filterPerResource.uri}> npx:appendsIndex* ?index . - ?index npx:includesElement ?np . - } UNION { - <${state.filterPerResource.uri}> npx:includesElement ?np . - } - }`; - } - } else { - // By default we show all nanopubs in the Knowledge Collaboratory - assertionBlocks.push(`?association biolink:aggregator_knowledge_source <${knowledgeProvider}> .`); - } - - let assertionGraphBlock = ''; - if (assertionBlocks.length > 0) { - assertionGraphBlock = `graph ?assertionGraph { - ${assertionBlocks.join('\n')} - }`; - } - - let provGraphBlock = ''; - if (provBlocks.length > 0) { - provGraphBlock = `graph ?provGraph { - ${provBlocks.join('\n')} - }`; - } - - let filterPubkey = ''; - if (state.filter_user && state.filter_user.pubkey) { - filterPubkey = `FILTER contains(?pubkey, "${state.filter_user.pubkey.value}")`; - } - - const getLatestNanopubsQuery = - `prefix np: - prefix npa: - prefix npx: - prefix xsd: - prefix dct: - prefix biolink: - prefix luc: - prefix bif: - prefix npx: - - SELECT DISTINCT ?np ?date ?pubkey WHERE { - GRAPH npa:graph { - ?np npa:hasHeadGraph ?h . - ?np dct:created ?date . - ?np npa:hasValidSignatureForPublicKey ?pubkey. - } - GRAPH ?h { - ?np np:hasAssertion ?assertionGraph ; - np:hasPublicationInfo ?pubInfoGraph ; - np:hasProvenance ?provGraph . - } - ${assertionGraphBlock} - ${provGraphBlock} - ${filterNpIndexBlock} - FILTER not exists { - GRAPH npa:graph { - ?newversion npa:hasHeadGraph ?nh . - ?newversion npa:hasValidSignatureForPublicKey ?pubkey . - } - GRAPH ?nh { - ?newversion np:hasPublicationInfo ?ni . - } - GRAPH ?ni { - ?newversion npx:supersedes ?np . - } - } - FILTER not exists { - GRAPH npa:graph { - ?retraction npa:hasHeadGraph ?rh . - ?retraction npa:hasValidSignatureForPublicKey ?pubkey . - } - GRAPH ?rh { - ?retraction np:hasAssertion ?ra . - } - GRAPH ?ra { - ?somebody npx:retracts ?np . - } - } - ${filterPubkey} - } ORDER BY desc(?date) LIMIT ` + state.results_count; - - get_nanopubs_url = `${settings.nanopubSparqlUrl}?query=${encodeURIComponent(getLatestNanopubsQuery)}`; - console.log(`Search: sending SPARQL query to ${settings.nanopubSparqlUrl}`); - console.log(getLatestNanopubsQuery); - - // Get the list of signed nanopubs - axios - .get(get_nanopubs_url, { - headers: { - accept: 'application/json' - } - }) - .then(res => { - const nanopub_list = res.data['results']['bindings']; - const nanopub_obj: any = {}; - let np_count = 0; - for (const nanopub of nanopub_list) { - // Fix purl URIs to use https (cant query http from https with js) - const np_uri = nanopub['np']['value'].replace('http://purl.org/np/', 'https://purl.org/np/'); - nanopub_obj[np_uri] = nanopub; - - np_count++; - if (np_count >= state.results_count) { - break; - } - } - updateState({ - nanopub_obj: nanopub_obj, - nanopub_list: nanopub_list, - loading_nanopubs: false - }); - Object.keys(nanopub_obj).map((nanopub_url: any) => { - // Finally iterate over the list of nanopubs to get their RDF content - axios - .get(nanopub_url, { - headers: { - accept: 'application/trig' - } - }) - .then(res => { - nanopub_obj[nanopub_url]['rdf'] = res.data; - nanopub_obj[nanopub_url]['expanded'] = false; - nanopub_obj[nanopub_url]['expanded_graph'] = false; - nanopub_obj[nanopub_url]['cytoscape'] = rdfToCytoscape(nanopub_obj[nanopub_url]['rdf']); - setNanopubObj({...nanopub_obj}); - updateState({ - nanopub_obj: nanopub_obj - }); - }) - .catch(error => { - console.log(error); - }); - }); - }) - .catch(error => { - console.log(error); - }); - }; - - const handleSearch = (event: any) => { - event.preventDefault(); - updateState({ - nanopub_obj: {}, - loading_nanopubs: true - }); - getNanopubs(state.search); - }; - - const searchChange = (event: React.ChangeEvent) => { - updateState({search: event.target.value}); - }; - // const hideAllNanopubs = () => { - // Object.keys(state.nanopub_obj).map((np: any) => { - // const expand_nanopub = state.nanopub_obj[np] - // expand_nanopub['expanded'] = false - // updateState({nanopub_obj: {...state.nanopub_obj, [np]: expand_nanopub} }); - // }) - // } - - return ( - - {/* - 🔍️ Browse Nanopublications - */} -

🔍️ Browse Nanopublications

- - {/* Filtering options */} - - {/* Search box */} -
- - - - - - -
- - -b.firstLetter.localeCompare(a.firstLetter))} - getOptionLabel={(option: any) => option.name.value} - // sx={{ width: 250 }} - renderInput={params => ( - - )} - onChange={(event, newInputValue: any) => { - updateState({ - filter_user: newInputValue - }); - }} - style={{backgroundColor: '#ffffff', minWidth: '30ch'}} - /> - - -b.firstLetter.localeCompare(a.firstLetter))} - getOptionLabel={(option: any) => option.label} - sx={{width: 250}} - renderInput={params => } - onChange={(event, newInputValue: any) => { - updateState({ - filterPerResource: newInputValue - }); - }} - style={{backgroundColor: '#ffffff', minWidth: '32ch'}} - /> - - { - updateState({results_count: e.target.value}); - }} - label="Number of results" - type="number" - variant="outlined" - style={{backgroundColor: '#ffffff'}} - inputProps={{style: {color: 'var(--color-grey-dark)', opacity: '0.9'}}} - size="small" - /> -
- - {!state.loading_nanopubs && ( -

🗃️ {Object.keys(state.nanopub_obj).length} nanopublications found

- )} - - {state.loading_nanopubs && ( - - - - )} - - {/* Iterate over nanopubs and display them */} - {Object.keys(state.nanopub_obj).map((np: any, key: number) => ( - - ))} -
- ); -} diff --git a/astro-frontend/src/app/PageShapePublisher.tsx b/astro-frontend/src/app/PageShapePublisher.tsx deleted file mode 100644 index 1558d93..0000000 --- a/astro-frontend/src/app/PageShapePublisher.tsx +++ /dev/null @@ -1,279 +0,0 @@ -import React from 'react'; -// import { useLocation } from "react-router-dom"; -import {Typography, Container} from '@mui/material'; - -import ShapeUploader from '../components/shape-publisher/ShapeUploader'; -// import CsvUploader from "../../src/components/CsvUploader"; -// import RenderObjectForm from "../../src/components/RenderObjectForm"; -import {JsonldForm} from '../components/shape-publisher/JsonldForm'; -// import { JsonldEditor, JsonldForm } from 'json-ld-editor-react'; - -export default function ShapePublisher() { - // TODO: use sx https://github.com/mui/material-ui/blob/master/examples/create-react-app-with-typescript/src/index.tsx - - // useLocation hook to get URL params - // let location = useLocation(); - const [state, setState] = React.useState({ - // shapeFile: shapeFile, - shapeFile: shapeFile, - shapeTarget: 'https://w3id.org/kg-metadata/KgMetadataShape', - open: false, - dialogOpen: false, - csvwColumnsArray: [], - jsonld_uri_provided: null, - ontology_jsonld: {}, - edit_enabled: true, - ontoload_error_open: false, - ontoload_success_open: false, - sparql_endpoint: '', - sparql_username: '', - sparql_password: '' - }); - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - // Original form and output: - // Questions: https://github.com/kodymoodley/fair-metadata-generator/blob/main/questions.csv - // Full output: https://github.com/kodymoodley/fair-metadata-html-page-generator/blob/main/testdata/inputdata/test.jsonld - - // React.useEffect(() => { - // // Get the edit URL param if provided, and download ontology if @context changed - // // Ontology is stored in state.ontology_jsonld - // // and passed to renderObjectForm to resolve classes and properties - // const params = new URLSearchParams(location.search + location.hash); - // let jsonld_uri_provided = params.get('edit'); - // let editionEnabled = params.get('toysrus'); - // if (editionEnabled === 'closed') { - // // Disable edit if toysrus=closed - // updateState({ edit_enabled: false }) - // } - // if (jsonld_uri_provided) { - // axios.get(jsonld_uri_provided) - // .then(res => { - // updateState({ - // wizard_jsonld: res.data, - // jsonld_uri_provided: jsonld_uri_provided, - // }) - // downloadOntology(res.data['@context']) - // }) - // } else { - // downloadOntology(state.wizard_jsonld['@context']) - // } - - // }, [state.wizard_jsonld['@context']]) - - return ( - - {/* - 🧙‍♂️ FAIR Metadata Wizard, a JSON-LD editor 📝 - */} - - - ⚠️ Work in progress, currently available for demo purpose - {/* Load and edit JSON-LD RDF files in a user-friendly web interface, with autocomplete based on the classes and properties of the ontology magically loaded from @context ✨️ */} - - - { - updateState({shapeFile, shapeTarget}); - - // setTimeout(function() { - // console.log('shapeFile state after clicking upload', state.shapeFile) - // }, 300); - // window.location.reload() - }} - /> - - - - {/* */} - - ); -} - -// SHACL shapes examples: -// Articles: https://raw.githubusercontent.com/NCATS-Gamma/omnicorp/master/shacl/omnicorp-shapes.ttl - -const shapeFile = `@prefix : . -@prefix dctypes: . -@prefix schemaorg: . -@prefix void: . -@prefix pav: . -@prefix freq: . -@prefix xsd: . -@prefix rdfs: . -@prefix void-ext: . -@prefix cito: . -@prefix idot: . -@prefix sd: . -@prefix dct: . -@prefix sh: . -@prefix rdf: . -@prefix sio: . -@prefix lexvo: . -@prefix dcat: . -@prefix prov: . -@prefix foaf: . - -## Shape to describe how to describe a Knowledge graph metadata -# Used to generate JSON Schema based form at the DKG COST action - -# Target: https://w3id.org/kg-metadata/KgMetadataShape -:KgMetadataShape - a sh:NodeShape ; - sh:nodeKind sh:IRI ; - sh:targetClass dcat:Dataset ; - - sh:property [ - sh:path dct:title ; - sh:name "Title" ; - sh:description "To provide a name or formal title for the KG" ; - sh:severity sh:Violation ; - sh:minCount 1; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:nodeKind sh:Literal ; - ] ; - sh:property [ - sh:path dct:description ; - sh:name "Description" ; - sh:description "To provide a human readable description of the KG" ; - sh:severity sh:Violation ; - sh:minCount 1; - sh:maxCount 1; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - ] ; - sh:property [ - sh:path foaf:page ; - sh:name "Homepage URL" ; - sh:description "Page provides minimal information, link to access to data" ; - sh:severity sh:Violation ; - sh:minCount 0; - sh:nodeKind sh:IRI ; - ] ; - sh:property [ - sh:path dct:issued ; - sh:name "Published Date" ; - sh:description "To provide the date when the KG is published" ; - sh:severity sh:Violation ; - sh:minCount 1; - sh:maxCount 1; - # sh:nodeKind sh:IRI ; - # sh:datatype xsd:dateTime ; - sh:pattern "^\\\\d{4}-(0?[1-9]|1[012])\\\\-(0?[1-9]|[12][0-9]|3[01])$" ; - # sh:nodeKind sh:Literal ; - sh:or ( [ sh:datatype xsd:dateTime ] [ sh:datatype xsd:date ] [ sh:datatype xsd:gYearMonth ] [ sh:datatype xsd:gYear ] ) ; - ] ; - sh:property [ - sh:path void:vocabulary ; - sh:name "Vocabularies used" ; - sh:description "To specify the vocabularies used in the knowledge" ; - sh:severity sh:Violation ; - sh:minCount 1; - sh:nodeKind sh:IRI ; - # TODO: make an enum? - # sh:datatype xsd:dateTime ; - # sh:pattern "^\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])$" - # sh:or ( [ sh:datatype xsd:dateTime ] [ sh:datatype xsd:date ] [ sh:datatype xsd:gYearMonth ] [ sh:datatype xsd:gYear ] ) ; - ] ; - sh:property [ - sh:path foaf:depiction ; - sh:name "Meta graph (picture)" ; - sh:description "To provide an illustration of the graph connectivity through its types and relations between instances" ; - sh:severity sh:Violation ; - sh:minCount 1; - sh:nodeKind sh:IRI ; - ] ; - - sh:property [ - sh:path dct:language ; - sh:severity sh:Warning ; - sh:name "Language" ; - sh:description "Language of the distribution" ; - sh:message "Distribution SHOULD use dct:language with a lexvo URI: http://lexvo.org/id/iso639-3/{tag}" ; - sh:minCount 1; - sh:nodeKind sh:IRI - ] ; - sh:property [ - sh:path pav:version ; - sh:name "Version" ; - sh:description "To specify the version of the dataset, if defined" ; - sh:severity sh:Warning ; - sh:minCount 1; - sh:maxCount 1; - sh:nodeKind sh:Literal ; - ] ; - sh:property [ - sh:path dct:license ; - sh:name "License" ; - # sh:description "To specify the version of the dataset, if defined" ; - sh:severity sh:Warning ; - sh:minCount 1; - sh:maxCount 1; - sh:nodeKind sh:IRI - ] ; - sh:property [ - sh:path dcat:keyword ; - sh:name "Keywords" ; - sh:description "To provide a set of descriptors for the KG" ; - sh:minCount 1; - sh:nodeKind sh:Literal ; - # TODO: add array when maxCount > 1 - ] ; - sh:property [ - sh:path dct:accessRight ; - sh:name "KG Accessibility" ; - sh:description "To provide a set of descriptors for the KG" ; - sh:minCount 0; - sh:nodeKind sh:Literal ; - # TODO: add array when maxCount > 1 - ] ; - - - - - - sh:property [ - sh:path dcat:Distribution ; - sh:name "Distributions" ; - sh:description "To provide different concrete distributions (files) of the resource" ; - # sh:minCount 1; - # sh:nodeKind sh:IRI ; - sh:node :DistributionShape ; - ] ; - . - - - -:DistributionShape - a sh:NodeShape ; - sh:targetClass dcat:Distribution ; - sh:nodeKind sh:IRI ; - - sh:property [ - sh:path dcat:accessURL ; - sh:name "Access URL" ; - sh:description "URL to download or access the distribution (e.g. file)" ; - sh:severity sh:Violation ; - sh:minCount 0 ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:nodeKind sh:Literal ; - ] ; - . -`; diff --git a/astro-frontend/src/components/AutocompleteEntity.tsx b/astro-frontend/src/components/AutocompleteEntity.tsx deleted file mode 100644 index efd5615..0000000 --- a/astro-frontend/src/components/AutocompleteEntity.tsx +++ /dev/null @@ -1,97 +0,0 @@ -'use client'; - -import React from 'react'; -import {Autocomplete, TextField} from '@mui/material'; - -const getAutocompleteLabel = (option: any, displayProp: string = '') => { - if (displayProp) { - return option[displayProp]; - } - - if (option.id_label && option.id_curie) { - return option.id_label + ' (' + option.id_curie + ')'; - } - if (option.text && option.id_curie) { - return option.text + ' (' + option.id_curie + ')'; - } - if (option.label && option.curie) { - if (option.altLabel) { - return `${option.label}, ${option.altLabel} (${option.curie})`; - } - return option.label + ' (' + option.curie + ')'; - } - // getOptionLabel={(option: any) => `${option.label}${option.altLabel ? `, ${option.altLabel}` : ''} (${option.curie})`} - if (option.label && option.id) { - return option.label + ' (' + option.id + ')'; - } - if (option.id_uri) return option.id_uri; - if (option.text) return option.text; - if (option.label) return option.label; - if (option.id) return option.id; - if (typeof option === 'string') { - return option; - } else { - return ''; - } -}; - -const checkIfUri = (text: string) => { - return /^https?:\/\/[-_\/#:\?=\+%\.0-9a-zA-Z]+$/i.test(text); -}; - -const checkIfEntity = (entity: any) => { - if (!entity) return false; - if (entity.id_uri) return checkIfUri(entity.id_uri); - if (entity.id) return checkIfUri(entity.id); - return checkIfUri(entity); -}; - -const AutocompleteEntity = ({ - label, - value, - onChange, - id, - options, - entity, - validate, - getOptionLabel = (option: any) => getAutocompleteLabel(option), - groupBy = (option: any) => (option.type ? option.type : null), - ...args -}: any) => { - // - return ( - ( - - )} - {...args} - /> - ); -}; -export default AutocompleteEntity; diff --git a/astro-frontend/src/components/CytoscapeRdf.tsx b/astro-frontend/src/components/CytoscapeRdf.tsx deleted file mode 100644 index 52258a0..0000000 --- a/astro-frontend/src/components/CytoscapeRdf.tsx +++ /dev/null @@ -1,507 +0,0 @@ -import React, {useEffect, useRef} from 'react'; -import {Card, Typography} from '@mui/material'; -import {renderToStaticMarkup} from 'react-dom/server'; -import {Parser} from 'n3'; -import cytoscape from 'cytoscape'; -import fcose from 'cytoscape-fcose'; -import cola from 'cytoscape-cola'; -import dagre from 'cytoscape-dagre'; -import spread from 'cytoscape-spread'; -import COSEBilkent from 'cytoscape-cose-bilkent'; -import popper from 'cytoscape-popper'; -// import euler from 'cytoscape-euler'; - -cytoscape.use(fcose); -cytoscape.use(dagre); -cytoscape.use(cola); -spread(cytoscape); -cytoscape.use(COSEBilkent); -cytoscape.use(popper); -// Cytoscape.use(euler) // out of memory - -// Install dependencies: -// yarn add cytoscape cytoscape-cola - -// Add tooltip? https://www.npmjs.com/package/cytoscape-popper/v/1.0.3 -// Edit graph? https://github.com/iVis-at-Bilkent/cytoscape.js-expand-collapse - -const replacePrefix = (uri: string, prefixes: any) => { - // const namespace = (uri.lastIndexOf('#') > 0) ? uri.lastIndexOf('#') : uri.lastIndexOf('/') - for (let i = 0; i < Object.keys(prefixes).length; i++) { - const prefix = Object.keys(prefixes)[i]; - if (uri.startsWith(prefixes[prefix])) { - return uri.replace(prefixes[prefix], prefix + ':'); - } - } - return uri; -}; - -export const rdfToCytoscape = (text: string) => { - const parser = new Parser({format: 'application/trig'}); - const cytoscapeElems: any = []; - const graphs: any = {}; - parser.parse(text, (error, quad, prefixes) => { - if (error) { - console.log(error); - return null; - } - if (quad && quad.subject.value && quad.object.value) { - // console.log("quad", quad.object.termType) - // Subject and Object nodes - cytoscapeElems.push({ - data: { - id: quad.subject.value, - label: quad.subject.value, - shape: 'ellipse', - backgroundColor: '#90caf9', - // parent: 'graph-' + quad.graph.value, - parent: quad.graph.value, - valign: 'center', - fontSize: '30px', - fontWeight: '300', - textColor: '#212121' - // https://stackoverflow.com/questions/58557196/group-nodes-together-in-cytoscape-js - } - }); - // For literal that are too long without spaces, like public keys - const cutLongObject = - !quad.object.value.includes(' ') && quad.object.value.length > 100 - ? quad.object.value.replace(/(.{60})/g, '$1\n') - : quad.object.value; - cytoscapeElems.push({ - data: { - id: quad.object.value, - label: cutLongObject, - shape: quad.object.termType == 'NamedNode' ? 'ellipse' : 'round-rectangle', - backgroundColor: quad.object.termType == 'NamedNode' ? '#90caf9' : '#80cbc4', // blue or green - textColor: '#000000', // black - // parent: 'graph-' + quad.graph.value, - parent: quad.graph.value, - valign: 'center', - fontSize: '30px', - fontWeight: '300' - } - }); - // Add Predicate edge to cytoscape graph - cytoscapeElems.push({ - data: { - source: quad.subject.value, - target: quad.object.value, - label: quad.predicate.value - } - }); - // Add the graph to the list of graphs - graphs[quad.graph.value] = quad.graph.value; - } else { - Object.keys(graphs).map((g: string) => { - let graphColor = '#eceff1'; - let graphTextColor = '#000000'; - if (g.endsWith('assertion')) { - // blue - graphColor = '#e3f2fd'; - graphTextColor = '#0d47a1'; - } else if (g.endsWith('provenance')) { - // Red - graphColor = '#ffebee'; - graphTextColor = '#b71c1c'; - } else if (g.toLowerCase().endsWith('pubinfo')) { - // Yellow - graphColor = '#fffde7'; - graphTextColor = '#f57f17'; - } - // Add Graph node at start of cytoscape graph - cytoscapeElems.unshift({ - data: { - // id: 'graph-' + g, - id: g, - label: g, - shape: 'round-rectangle', - backgroundColor: graphColor, - textColor: graphTextColor, - valign: 'top', - fontSize: '50px', - fontWeight: '700' - } - }); - }); - - const allPrefixes = {...prefixes, rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'}; - // Resolve prefixes - cytoscapeElems.map((elem: any) => { - if (elem.data.label) { - elem.data.label = replacePrefix(elem.data.label, allPrefixes); - } - }); - } - }); - - // console.log('cytoscapeElems:', cytoscapeElems) - return cytoscapeElems; -}; - -const displayLink = (urlString: string) => { - if (/^(?:node[0-9]+)|((https?|ftp):.*)$/.test(urlString)) { - return ( - - {urlString} - - ); - } else { - return urlString; - } -}; - -// Component to display RDF as a graph with Cytoscape -// export default function CytoscapeRdfGraph(props: any) { -export function CytoscapeRdfGraph({ - rdf, - cytoscapeElems = rdfToCytoscape(rdf), - layout = defaultLayout['cose-bilkent'] -}: any) { - const containerRef: any = useRef(); - - useEffect(() => { - const config = { - container: containerRef.current, - style: cytoStyles, - elements: cytoscapeElems, - layout: layout, - boxSelectionEnabled: true, - autounselectify: true, - autoungrabify: false, - wheelSensitivity: 0.1, - showOverlay: true - }; - - // @ts-ignore - const cy = cytoscape(config); - - // Add on click actions to show cards with more details on an object - cy.$('node').on('tap', function (e: any) { - cy.edges().style({ - 'line-color': '#263238', - color: '#263238', - width: 2, - 'target-arrow-color': '#263238', - 'font-size': '30px' - }); // Grey - var ele = e.target; - ele.connectedEdges().style({ - 'line-color': '#c62828', - color: '#c62828', // red - width: 4, - 'target-arrow-color': '#c62828', - 'font-size': '40px' - }); - }); - // Show a card with the value of the node (e.g. clickable link for URI) - cy.$('node').on('tap', function (e: any) { - const oldEle = document.getElementById('cytoPop'); - if (oldEle) oldEle.remove(); - var ele = e.target; - // const elementLabel = (ele.id().startsWith('graph-http')) ? ele.id().replace('graph-http', '') : ele.id() - ele.popper({ - content: () => { - // console.log(ele) - let div = document.createElement('div'); - // Replace the start "graph-http" for graphs nodes URIs - const elementLabel = ele.id().startsWith('graph-http') ? ele.id().replace('graph-http', 'http') : ele.id(); - - // const staticElement = renderToStaticMarkup( - const staticElement = renderToStaticMarkup( - - {/* - - } - style={{paddingBottom: '0px'}}/> */} - {/* */} - {displayLink(elementLabel)} - {/* */} - - ); - div.innerHTML = `
${staticElement}
`; - document.body.appendChild(div); - // ReactDOM.render(staticElement, document.getElementById('root')); - return div; - } - }); - }); - // Remove Card when click on the canvas - cy.on('tap', function (event: any) { - if (event.target === cy) { - // tap on background - const oldEle = document.getElementById('cytoPop'); - if (oldEle) oldEle.remove(); - } - }); - }, []); - - const cytoStyles = [ - { - selector: 'edge', - style: { - label: 'data(label)', - color: '#263238', // Grey - 'line-color': '#263238', - width: 2, - 'arrow-scale': 2, - 'target-arrow-color': '#263238', - // 'target-arrow-color': '#ccc', - 'text-wrap': 'wrap' as const, - 'font-size': '30px', - 'text-opacity': 0.9, - 'target-arrow-shape': 'triangle' as const, - // Control multi edge on 2 nodes: - 'curve-style': 'bezier' as const, - 'control-point-step-size': 300 - // width: 15 - } - }, - { - selector: 'edge:parent', - style: { - color: '#c62828', // red - 'line-color': '#c62828', - width: 2, - 'arrow-scale': 2, - 'target-arrow-color': '#c62828' - // 'target-arrow-color': '#ccc', - } - }, - // { - // selector: 'edge.highlighted', - // style: { - // 'color': '#0d47a1', // blue - // } - // }, - { - selector: 'node', - style: { - label: 'data(label)', - 'text-wrap': 'wrap' as const, - // 'word-break': 'break-all', - 'overflow-wrap': 'break-word', - // 'white-space': 'pre-wrap', - 'text-max-width': '800px', - 'font-size': 'data(fontSize)', - // 'font-weight': 'data(fontWeight)', - 'text-valign': 'data(valign)' as const, - 'text-halign': 'center' as const, - width: 'label', - // width: 20, - height: 'label', - padding: '25px', - // https://js.cytoscape.org/#style/node-body - shape: 'data(shape)', - 'background-color': 'data(backgroundColor)', - color: 'data(textColor)' - // "color": 'data(color)', - } - } - ]; - - return ( - <> -
- - ); -} - -// Change Cytoscape layout: https://js.cytoscape.org/#layouts -// Layout options for dagre: -const defaultLayout = { - 'cose-bilkent': { - name: 'cose-bilkent', - // Called on `layoutready` - ready: function () {}, - // Called on `layoutstop` - stop: function () {}, - // 'draft', 'default' or 'proof" - // - 'draft' fast cooling rate - // - 'default' moderate cooling rate - // - "proof" slow cooling rate - quality: 'default', - // Whether to include labels in node dimensions. Useful for avoiding label overlap - nodeDimensionsIncludeLabels: false, - // number of ticks per frame; higher is faster but more jerky - refresh: 30, - // Whether to fit the network view after when done - fit: true, - // Padding on fit - padding: 10, - // Whether to enable incremental mode - randomize: true, - // Node repulsion (non overlapping) multiplier - nodeRepulsion: 4500, - // Ideal (intra-graph) edge length - idealEdgeLength: 200, - // Divisor to compute edge forces - edgeElasticity: 0.45, - // Nesting factor (multiplier) to compute ideal edge length for inter-graph edges - nestingFactor: 0.1, - // Gravity force (constant) - gravity: 0.25, - // Maximum number of iterations to perform - numIter: 2500, - // Whether to tile disconnected nodes - tile: true, - // Type of layout animation. The option set is {'during', 'end', false} - animate: false, - // Duration for animate:end - animationDuration: 500, - // Amount of vertical space to put between degree zero nodes during tiling (can also be a function) - tilingPaddingVertical: 10, - // Amount of horizontal space to put between degree zero nodes during tiling (can also be a function) - tilingPaddingHorizontal: 10, - // Gravity range (constant) for compounds - gravityRangeCompound: 1.5, - // Gravity force (constant) for compounds - gravityCompound: 1.0, - // Gravity range (constant) - gravityRange: 3.8, - // Initial cooling factor for incremental layout - initialEnergyOnIncremental: 0.5 - }, - fcose: { - name: 'fcose', - // 'draft', 'default' or 'proof' - // - "draft" only applies spectral layout - // - "default" improves the quality with incremental layout (fast cooling rate) - // - "proof" improves the quality with incremental layout (slow cooling rate) - quality: 'default', - // Use random node positions at beginning of layout - // if this is set to false, then quality option must be "proof" - randomize: true, - infinite: false, - // Whether or not to animate the layout - animate: false, - // Duration of animation in ms, if enabled - animationDuration: 1000, - // Easing of animation, if enabled - animationEasing: undefined, - // Fit the viewport to the repositioned nodes - fit: true, - // Padding around layout - padding: 30, - // Whether to include labels in node dimensions. Valid in "proof" quality - nodeDimensionsIncludeLabels: true, - // Whether or not simple nodes (non-compound nodes) are of uniform dimensions - uniformNodeDimensions: false, - // Whether to pack disconnected components - cytoscape-layout-utilities extension should be registered and initialized - packComponents: false, - // Layout step - all, transformed, enforced, cose - for debug purpose only - step: 'all', - // False for random, true for greedy sampling - samplingType: true, - // Sample size to construct distance matrix - sampleSize: 25, - // Separation amount between nodes - nodeSeparation: 200, - // Power iteration tolerance - piTol: 0.0000001, - /* incremental layout options */ - // Node repulsion (non overlapping) multiplier - nodeRepulsion: (node: any) => 4500, - // Ideal edge (non nested) length - idealEdgeLength: (edge: any) => 300, - // Divisor to compute edge forces - edgeElasticity: (edge: any) => 0.45, - // Nesting factor (multiplier) to compute ideal edge length for nested edges - nestingFactor: 0.4, - // Maximum number of iterations to perform - this is a suggested value and might be adjusted by the algorithm as required - numIter: 2500, - // For enabling tiling - tile: true, - // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function) - tilingPaddingVertical: 10, - // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function) - tilingPaddingHorizontal: 10, - // Gravity force (constant) - gravity: 0.25, - // Gravity range (constant) for compounds - gravityRangeCompound: 2, - // Gravity force (constant) for compounds - gravityCompound: 0.5, - // Gravity range (constant) - gravityRange: 3.8, - // Initial cooling factor for incremental layout - initialEnergyOnIncremental: 0.3, - /* constraint options */ - // Fix desired nodes to predefined positions - // [{nodeId: 'n1', position: {x: 100, y: 200}}, {...}] - fixedNodeConstraint: undefined, - // Align desired nodes in vertical/horizontal direction - // {vertical: [['n1', 'n2'], [...]], horizontal: [['n2', 'n4'], [...]]} - alignmentConstraint: undefined, - // Place two nodes relatively in vertical/horizontal direction - // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}, {...}] - relativePlacementConstraint: undefined - /* layout event callbacks */ - // ready: () => {}, // on layoutready - // stop: () => {} // on layoutstop - }, - dagre: { - name: 'dagre', - // dagre algo options, uses default value on undefined - nodeSep: undefined, // the separation between adjacent nodes in the same rank - edgeSep: undefined, // the separation between adjacent edges in the same rank - rankSep: undefined, // the separation between each rank in the layout - rankDir: 'TB', // 'TB' for top to bottom flow, 'LR' for left to right, - align: 'DR', // alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right - acyclicer: undefined, // If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph. - // A feedback arc set is a set of edges that can be removed to make a graph acyclic. - ranker: 'network-simplex', // Type of algorithm to assign a rank to each node in the input graph. Possible values: 'network-simplex', 'tight-tree' or 'longest-path' - minLen: function (edge: any) { - return 2; - }, // number of ranks to keep between the source and target of the edge - edgeWeight: function (edge: any) { - return 1; - }, // higher weight edges are generally made shorter and straighter than lower weight edges - - // general layout options - fit: true, // whether to fit to viewport - padding: 30, // fit padding - spacingFactor: 1, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - nodeDimensionsIncludeLabels: true, // whether labels should be included in determining the space used by a node - animate: false, // whether to transition the node positions - animateFilter: function (node: any, i: any) { - return true; - }, // whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - transform: function (node: any, pos: any) { - return pos; - }, // a function that applies a transform to the final node position - ready: function () {}, // on layoutready - stop: function () {} // on layoutstop - }, - cola: { - name: 'cola', - nodeSpacing: 150, - // edgeLengthVal: 1000, - animate: false, - randomize: false, - maxSimulationTime: 1500 - }, - // Spread: https://github.com/cytoscape/cytoscape.js-spread - spread: { - name: 'spread', - animate: true, // Whether to show the layout as it's running - ready: undefined, // Callback on layoutready - stop: undefined, // Callback on layoutstop - fit: true, // Reset viewport to fit default simulationBounds - minDist: 20, // Minimum distance between nodes - padding: 20, // Padding - expandingFactor: -1.0, // If the network does not satisfy the minDist - // criterium then it expands the network of this amount - // If it is set to -1.0 the amount of expansion is automatically - // calculated based on the minDist, the aspect ratio and the - // number of nodes - prelayout: {name: 'cose'}, // Layout options for the first phase - maxExpandIterations: 4, // Maximum number of expanding iterations - boundingBox: undefined, // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - randomize: false // Uses random initial node positions on true - } -}; diff --git a/astro-frontend/src/components/DisplayNanopub.tsx b/astro-frontend/src/components/DisplayNanopub.tsx deleted file mode 100644 index eb105fb..0000000 --- a/astro-frontend/src/components/DisplayNanopub.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import React from 'react'; -import {Typography, Card, Paper, IconButton, CardContent, CardActions, Collapse} from '@mui/material'; -import Icon from './Icon'; - -import hljs from 'highlight.js/lib/core'; -import 'highlight.js/styles/github-dark-dimmed.css'; -import hljsDefineTurtle from '../utils/highlightjs-turtle'; -hljs.registerLanguage('turtle', hljsDefineTurtle); - -import {CytoscapeRdfGraph} from '../components/CytoscapeRdf'; -// import "cytoscape-rdf"; -// import "nanopub-display"; - -const DisplayNanopub = ({np, npDict, index, usersPubkeys, ...args}: any) => { - const [state, setState] = React.useState({ - npDict: npDict, - shaclValidate: true, - loading: false, - open: false, - dialogOpen: false, - published_nanopub: '', - errorMessage: ' ' - }); - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - const handleExpandClick = (e: any) => { - const expand_nanopub = state.npDict[e.currentTarget.name]; - expand_nanopub['expanded'] = !expand_nanopub['expanded']; - updateState({npDict: {...state.npDict, [e.currentTarget.name]: expand_nanopub}}); - console.log('expand_nanopub', expand_nanopub); - console.log('handleExpandClick', e.currentTarget.name, state.npDict); - setTimeout(function () { - hljs.highlightAll(); - }, 200); - }; - const handleExpandGraphClick = (e: any) => { - const expand_nanopub = state.npDict[e.currentTarget.name]; - expand_nanopub['expanded_graph'] = !expand_nanopub['expanded_graph']; - updateState({npDict: {...state.npDict, [e.currentTarget.name]: expand_nanopub}}); - }; - - return ( - - - {/* General infos about the nanopub */} - - - {np} - - {/* {np} */} - - - Published on the {state.npDict[np]['date']['value']} - {usersPubkeys[state.npDict[np]['pubkey']['value']] && ( - <> - {/*  by */} -  by{' '} - - {usersPubkeys[state.npDict[np]['pubkey']['value']]['name']['value']} - - - )} - - - - {/* Buttons to expand the nanopub RDF or graph */} - - {state.npDict[np]['rdf'] && ( - - {!state.npDict[np]['expanded'] && ( - <> - Display the Nanopublication RDF - - - )} - {state.npDict[np]['expanded'] && ( - <> - Hide the Nanopublication RDF - - - )} - - )} - {state.npDict[np] && state.npDict[np]['cytoscape'] && ( - - {!state.npDict[np]['expanded_graph'] && ( - <> - Display the Nanopublication graph - - - )} - {state.npDict[np]['expanded_graph'] && ( - <> - Hide the Nanopublication graph - - - )} - - )} - - - {/* Display RDF when expanded */} - {/* unmountOnExit */} - {state.npDict[np] && state.npDict[np]['rdf'] && ( - - - {/* */} -
-              
-                {state.npDict[np]['rdf']}
-              
-            
-
-
- )} - - {/* Display graph when expanded */} - {state.npDict[np]['cytoscape'] && state.npDict[np] && ( - - - - - - - - )} -
- ); -}; -export default DisplayNanopub; diff --git a/astro-frontend/src/components/DropdownButton.tsx b/astro-frontend/src/components/DropdownButton.tsx deleted file mode 100644 index 4313e47..0000000 --- a/astro-frontend/src/components/DropdownButton.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import * as React from 'react'; -import {Button, ButtonGroup, ClickAwayListener, Grow, Paper, Popper, MenuItem, MenuList} from '@mui/material'; -import Icon from './Icon'; - -export default function DropdownButton({onChange, onClick, options, loggedIn}: any) { - const [open, setOpen] = React.useState(false); - const anchorRef = React.useRef(null); - const [selectedIndex, setSelectedIndex] = React.useState(options.length - 1); - - const handleClick = () => { - onClick(); - // console.info(`You clicked ${options[selectedIndex]}`); - }; - - const handleMenuItemClick = (event: React.MouseEvent, index: number) => { - setSelectedIndex(index); - setOpen(false); - onChange(event, index); - }; - - const handleToggle = () => { - setOpen(prevOpen => !prevOpen); - }; - - const handleClose = (event: Event) => { - if (anchorRef.current && anchorRef.current.contains(event.target as HTMLElement)) { - return; - } - - setOpen(false); - }; - - return ( - - - - - - - {({TransitionProps, placement}) => ( - - - - - {options.map((option: any, index: any) => ( - handleMenuItemClick(event, index)} - > - {option} - - ))} - - - - - )} - - - ); -} diff --git a/astro-frontend/src/components/Icon.astro b/astro-frontend/src/components/Icon.astro deleted file mode 100644 index 235f957..0000000 --- a/astro-frontend/src/components/Icon.astro +++ /dev/null @@ -1,11 +0,0 @@ ---- -export interface Props { - name: string; -} - -const {name} = Astro.props; ---- - - - {name} - diff --git a/astro-frontend/src/components/Icon.tsx b/astro-frontend/src/components/Icon.tsx deleted file mode 100644 index 06ad575..0000000 --- a/astro-frontend/src/components/Icon.tsx +++ /dev/null @@ -1,4 +0,0 @@ -const Icon = ({name}: any) => { - return {name}; -}; -export default Icon; diff --git a/astro-frontend/src/components/OrcidLogin.tsx b/astro-frontend/src/components/OrcidLogin.tsx deleted file mode 100644 index 2a66262..0000000 --- a/astro-frontend/src/components/OrcidLogin.tsx +++ /dev/null @@ -1,194 +0,0 @@ -import React, {useContext} from 'react'; -// import Link from 'next/link'; -// import Image from 'next/image'; -// import { Image } from '@astrojs/image/components'; -import {AppBar, Toolbar, Button, Tooltip, Icon as MuiIcon, IconButton, Box, ButtonBase} from '@mui/material'; -import {Popper, ClickAwayListener, Typography, Paper, Checkbox, FormControlLabel, FormHelperText} from '@mui/material'; -import {useStore} from '@nanostores/react'; -import {userProfile} from '../utils/nanostores'; - -import axios from 'axios'; - -import {settings} from '../utils/settings'; -// import { useAuth } from 'oidc-react'; -// @ts-ignore -import OAuth2Login from 'react-simple-oauth2-login'; -import Icon from './Icon'; - -const OrcidLogin = ({np, npDict, index, usersPubkeys, ...args}: any) => { - // const auth = useAuth(); - - const $userProfile = useStore(userProfile); - - const [state, setState] = React.useState({ - currentUsername: null, - accessToken: null, - loggedIn: false - }); - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - // Settings for Popper - const [open, setOpen] = React.useState(false); - const [anchorEl, setAnchorEl]: any = React.useState(null); - const showUserInfo = (event: any) => { - setAnchorEl(anchorEl ? null : event.currentTarget); - // setAnchorEl(anchorEl ? null : document.body); - setOpen(prev => !prev); - }; - const handleClickAway = () => { - setOpen(false); - setAnchorEl(anchorEl ? null : anchorEl); - }; - const id = open ? 'simple-popper' : undefined; - - const onSuccess = (response: any) => { - getCurrentUser(response); - }; - const onFailure = (response: any) => console.error(response); - - const logout = () => { - localStorage.clear(); - userProfile.set({}); - handleClickAway(); - }; - - const getCurrentUser = (configState: any) => { - console.log('CURRENT USER ACCESS TOKEN', configState); - axios - .get(settings.apiUrl + '/current-user', { - headers: { - 'Content-Type': 'application/json', - Authorization: 'Bearer ' + configState['access_token'] - } - }) - .then((res: any) => { - let current_user = res.data; - // console.log('Current user:', current_user) - current_user['access_token'] = configState['access_token']; - if (!current_user.error) { - current_user['access_token'] = configState['access_token']; - if (current_user['given_name'] || current_user['family_name']) { - current_user['username'] = current_user['given_name'] + ' ' + current_user['family_name']; - } else if (current_user['name']) { - current_user['username'] = current_user['name']; - } else { - current_user['username'] = current_user['sub']; - } - userProfile.set(current_user); - localStorage.setItem('knowledgeCollaboratorySettings', JSON.stringify(current_user)); - } else { - // The token stored might not be valid anymore, deleting it to avoid spamming the API - localStorage.removeItem('knowledgeCollaboratorySettings'); - } - // https://stackoverflow.com/questions/25686484/what-is-intent-of-id-token-expiry-time-in-openid-connect - // If the token is expired, it should make another auth request, except this time with prompt=none in the URL parameter - // Getting an error with prompt if not login - - // localStorage.setItem("knowledgeCollaboratorySettings", JSON.stringify(user)); - // window.location.reload(); - }) - .catch((error: any) => { - if (error.response) { - // Request made and server responded - console.log(error.response.data); - console.log(error.response.status); - console.log(error.response.headers); - } else if (error.request) { - // The request was made but no response was received - console.log(error.request); - } else { - // Something happened in setting up the request that triggered an Error - console.log('Error', error.message); - } - }); - }; - - React.useEffect(() => { - const localStorageConfig: any = localStorage.getItem('knowledgeCollaboratorySettings'); - let configState: any = JSON.parse(localStorageConfig); - if (configState && configState['access_token']) { - getCurrentUser(configState); - } - // }, [user]) - }, []); - - return ( - <> - {!$userProfile || - (!$userProfile.username && ( - - - - ))} - - {$userProfile && $userProfile.username && ( - - )} - - {$userProfile && $userProfile.username && ( - - - - - Logged in with ORCID:{' '} - { - - {$userProfile.id} - - } - - Username: {$userProfile.username} - - - - - )} - - ); -}; - -export default OrcidLogin; diff --git a/astro-frontend/src/components/PubAnnotationProjects.tsx b/astro-frontend/src/components/PubAnnotationProjects.tsx deleted file mode 100644 index d1f7fbc..0000000 --- a/astro-frontend/src/components/PubAnnotationProjects.tsx +++ /dev/null @@ -1,173 +0,0 @@ -import React, {useEffect} from 'react'; -import {Autocomplete, TextField, Button, Typography, Box} from '@mui/material'; -import axios from 'axios'; -import {settings} from '../utils/settings'; - -const PubAnnotationProjects = ({ - onClick, - id, - value, - // groupBy=(option: any) => (option.type ? option.type : null), - ...args -}: any) => { - const [state, setState] = React.useState({ - projects: [], - projectSelected: { - author: '', - created_at: '', - license: '', - maintainer: '', - name: '', - updated_at: '', - url: '', - countPublished: '' - }, - countPublished: -1, - loadedDocs: [], - loadDoc: {url: '', sourcedb: '', sourceid: ''}, - loading: false, - open: false, - dialogOpen: false, - published_nanopub: '', - errorMessage: ' ' - }); - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - useEffect(() => { - axios - .get('https://pubannotation.org/projects.json', { - headers: { - accept: 'application/json' - } - }) - .then(res => { - console.log(res.data); - updateState({ - projects: res.data - }); - }) - .catch(error => { - console.log(error); - }); - }, []); - - const onChange = async (event: any, newInputValue: any) => { - console.log('newInputValue', newInputValue); - if (newInputValue && newInputValue.name) { - newInputValue['url'] = `https://pubannotation.org/projects/${newInputValue.name}`; - // TODO: get the number of annotations already done for this project - // And fetch the annotation for this number + 1 (get the right page by /10) - const getAlreadyPublishedQuery = `prefix np: - prefix npa: - prefix npx: - prefix xsd: - prefix dct: - prefix biolink: - prefix tao: - - SELECT (count(DISTINCT ?s) AS ?count) WHERE { - ?s tao:part_of <${newInputValue['url']}> - }`; - const alreadyPublished = await axios.get( - `${settings.nanopubSparqlUrl}?query=${encodeURIComponent(getAlreadyPublishedQuery)}` - ); - const countPublished = parseInt(alreadyPublished.data.results.bindings[0].count.value); - updateState({projectSelected: newInputValue, countPublished: countPublished}); - } - }; - - const onClickLoad = async () => { - const page = state.countPublished == 0 ? 1 : state.countPublished / 10; - const numberInPage = state.countPublished == 0 ? 0 : state.countPublished % 10; - - axios - .get(`${state.projectSelected.url}/docs.json?page=${page}`, { - headers: { - accept: 'application/json' - } - }) - .then(res => { - getDocToAnnotate(res.data[numberInPage]); - }) - .catch(error => { - console.log(error); - }); - }; - - const getDocToAnnotate = async (annotateDoc: any) => { - const res = await axios.get(`${annotateDoc.url.replace('http://', 'https://')}.json`); - res.data['project'] = state.projectSelected.url; - onClick(res.data); - return res.data; - }; - - const label = 'Select a PubAnnotation project to load a document to annotate'; - - return ( - <> - - { - return option.name; - }} - // groupBy={groupBy} - style={{width: '60%', marginRight: '16px'}} - renderInput={params => ( - - )} - {...args} - /> - - - {state.countPublished >= 0 && ( - - 📝 {state.countPublished} documents have been annotated for the{' '} - - {state.projectSelected.name} - {' '} - PubAnnotation project - - )} - - ); -}; -export default PubAnnotationProjects; diff --git a/astro-frontend/src/components/PublishNanopubButtons.tsx b/astro-frontend/src/components/PublishNanopubButtons.tsx deleted file mode 100644 index 15c73f5..0000000 --- a/astro-frontend/src/components/PublishNanopubButtons.tsx +++ /dev/null @@ -1,355 +0,0 @@ -import React from 'react'; -import axios from 'axios'; -import {Typography, Paper, Checkbox, FormControlLabel, Button, Card} from '@mui/material'; - -import {settings, genericContext} from '../utils/settings'; -import {FormSettings} from './StyledComponents'; -import Icon from './Icon'; - -import hljs from 'highlight.js/lib/core'; -import 'highlight.js/styles/github-dark-dimmed.css'; -import hljsDefineTurtle from '../utils/highlightjs-turtle'; -hljs.registerLanguage('turtle', hljsDefineTurtle); - -// import { rdfToRdf } from '../utils/utils'; - -const PublishNanopubButtons = ({ - user, - generateRDF, - entitiesList, - inputSource, - nanopubGenerated, - nanopubPublished, - errorMessage, - ...args -}: any) => { - const [state, setState] = React.useState({ - shaclValidate: true, - loading: false, - open: false, - nanopubGenerated: nanopubGenerated, - nanopubPublished: nanopubPublished, - dialogOpen: false, - published_nanopub: '', - errorMessage: '' - }); - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - const handleDownloadRDF = (event: React.FormEvent) => { - // Trigger JSON-LD file download - event.preventDefault(); - const stmtJsonld: any = generateRDF(); - // rdfToRdf(stmtJsonld) - // .then((formattedRdf: any) => { - // console.log(formattedRdf); - // }) - var element = document.createElement('a'); - element.setAttribute( - 'href', - 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(stmtJsonld, null, 4)) - ); - element.setAttribute('download', 'annotation.json'); - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); - }; - - const publishSignedNanopub = (event: React.FormEvent) => { - event.preventDefault(); - if (!user.error) { - const access_token = user['access_token']; - axios - .post(`${settings.apiUrl}/publish-last-signed`, null, { - headers: {Authorization: `Bearer ${access_token}`} - // params: requestParams - }) - .then(res => { - updateState({ - open: true, - nanopubPublished: true, - published_nanopub: res.data - }); - }) - .catch(error => { - updateState({ - nanopubPublished: false, - errorMessage: 'Error publishing the Nanopublication: ' + error - }); - console.log(error); - }) - .finally(() => { - setTimeout(function () { - hljs.highlightAll(); - }, 200); - }); - } else { - console.log('You need to be logged in with ORCID to publish a Nanopublication'); - } - }; - - const handleShaclValidate = (event: React.ChangeEvent) => { - updateState({shaclValidate: event.target.checked}); - }; - - const generateNanopub = (event: React.FormEvent, publish: boolean = false) => { - event.preventDefault(); - updateState({errorMessage: '', published_nanopub: ''}); - const stmtJsonld: any = generateRDF(); - if (!user.error) { - // console.log('Publishing!', publish, stmtJsonld) - const requestParams: any = { - publish: publish - }; - requestParams['shacl_validation'] = state.shaclValidate; - if (inputSource) { - requestParams['source'] = inputSource; - } - const access_token = user['access_token']; - axios - .post(`${settings.apiUrl}/assertion`, stmtJsonld, { - headers: {Authorization: `Bearer ${access_token}`}, - params: requestParams - }) - .then(res => { - updateState({ - open: true, - nanopubGenerated: true, - nanopubPublished: false, - published_nanopub: res.data - }); - }) - .catch(error => { - updateState({ - errorMessage: `Error generating the Nanopublication:\n${error.response.data.detail}`, - nanopubGenerated: false, - nanopubPublished: false - }); - console.log(error.response.data.detail); - }) - .finally(() => { - setTimeout(function () { - hljs.highlightAll(); - }, 200); - }); - } else { - console.log('You need to be logged in with ORCID to publish a Nanopublication'); - } - }; - - const handleUploadKeys = (event: React.FormEvent) => { - event.preventDefault(); - const formData = new FormData(); - // @ts-ignore - formData.append('publicKey', event.currentTarget.elements.publicKey.files[0]); - // @ts-ignore - formData.append('privateKey', event.currentTarget.elements.privateKey.files[0]); - axios - .post(settings.apiUrl + '/upload-keys', formData, { - headers: { - Authorization: `Bearer ${user['access_token']}`, - 'Content-Type': 'multipart/form-data', - type: 'formData' - } - }) - .then(res => { - updateState({ - open: true - }); - }) - .catch(error => { - updateState({ - open: false, - errorMessage: - 'Error while uploading keys, please retry. And feel free to create an issue on our GitHub repository if the issue persists.' - }); - console.log('Error while uploading keys', error); - }) - .finally(() => { - window.location.reload(); - }); - }; - - const handleGenerateKeys = (event: any) => { - event.preventDefault(); - - const access_token = user['access_token']; - axios - .get(settings.apiUrl + '/generate-keys', { - headers: { - Authorization: `Bearer ${access_token}` - } - }) - .then(res => { - updateState({ - open: true - }); - }) - .catch(error => { - updateState({ - open: false, - errorMessage: - 'Error while uploading keys, please retry. And feel free to create an issue on our GitHub repository if the issue persists.' - }); - console.log('Error while uploading keys', error); - }) - .finally(() => { - window.location.reload(); - }); - }; - - return ( - <> -
- - {/* Button to download the JSON-LD */} -
- - - } - label="Validate with BioLink SHACL shapes" - /> - {state.nanopubGenerated && ( - - )} - {!user.id && ( - - 🔒️ You need to login with your ORCID to generate Nanopublications - - )} -
-
-
- - {state.nanopubPublished && ( - - ✅  Nanopublication successfully published - - )} - - {state.errorMessage && ( - 0}} - > -
⚠️  {state.errorMessage}
-
- )} - - {user.id && ( - - {user.keyfiles_loaded && ( - - ✅ Your keys have been loaded successfully, you can start publishing Nanopublications - - )} - - {!user.keyfiles_loaded && ( - <> - - 🔑 Before publishing nanopubs, you need to first generate a private/public key pair, and then publish an - introduction nanopub to link this key pair to your ORCID. -
- We can automate this process for you, upon clicking the button above we will generate a key pair, and - publish a nanopublication to link it to your ORCID: -
- {/*
*/} -
- -
- - 📤️ Or, if you already have registered a key pair with your ORCID in the nanopublication network, you - can upload these keys directly: - -
- - Select the Public key:   - - - - Select the Private key:   - - - - -
- - )} - - )} - - {state.published_nanopub && ( -
-          {state.published_nanopub}
-        
- )} - - ); -}; -export default PublishNanopubButtons; diff --git a/astro-frontend/src/components/ReactTaggy.tsx b/astro-frontend/src/components/ReactTaggy.tsx deleted file mode 100644 index 86fa836..0000000 --- a/astro-frontend/src/components/ReactTaggy.tsx +++ /dev/null @@ -1,284 +0,0 @@ -import React from 'react'; - -interface Span { - token: string; - type: string; - start: number; - end: number; -} - -// Define functional component. Destructure the props. -const Taggy = ({ - text = '', - spans = [], - ents = [], - onClick = (event: any, tag: Span, elemIndex: number) => {}, - onMouseOver = (event: any, tag: Span, elemIndex: number) => {}, - onHighlight = (event: Span, text: string, spanIndex: number, start: number, end: number) => {} -}: any) => { - // Find the correct color of the given entity type. If the given entity is not found, set the color to grey. - const findRed = (type: string) => { - for (let e = 0; e < ents.length; e++) { - if (ents[e].type === type) { - return ents[e].color.r; - } - } - return 220; - }; - const findGreen = (type: string) => { - for (let e = 0; e < ents.length; e++) { - if (ents[e].type === type) { - return ents[e].color.g; - } - } - return 220; - }; - const findBlue = (type: string) => { - for (let e = 0; e < ents.length; e++) { - if (ents[e].type === type) { - return ents[e].color.b; - } - } - return 220; - }; - - const highlightCallback = (e: any, spanText: string, i: number) => { - // Start and end are relative to the current element, not the whole text - const start = window.getSelection()!.anchorOffset; - const end = window.getSelection()!.focusOffset; - const highlightedText = spanText.substring(start, end); - onHighlight(e, highlightedText, i, text.indexOf(spanText) + start, text.indexOf(spanText) + end); - }; - - // Initialize an empty array that will hold the text and entities - let jsx: any = []; - - // Make sure spans are ordered by they start index - spans.sort((a: any, b: any) => (a.start > b.start ? 1 : b.start > a.start ? -1 : 0)); - - // METHOD 1 - STRING - if (typeof text === 'string') { - // Initialize an empty array. The contents of 'elements' will eventually get pushed to the 'jsx' array, and will be converted to jsx markup in the process. - let elements: any = []; - // Keep track of location in the string of text - let offset = 0; - // Loop through the spans, using the span data to construct the 'elements' array - spans.forEach((span: Span) => { - // Create a string of text that does not contain any entities - const fragment = text.slice(offset, span.start); - // Create an entity - const entity = text.slice(span.start, span.end); - // Push the both of them to the elements array - elements.push(fragment); - span.token = entity; - elements.push(span); - // Update our position within the string of text - offset = span.end; - }); - // After pushing all of the entities to the 'elements' array, push the remaining text to the 'elements' array. Elements should now consist of strings and objects/entities. - elements.push(text.slice(offset, text.length)); - // Filter out unnecessary spaces - elements = elements.filter((val: any) => val !== ' '); - // Loop through elements array looking for multi-word entities. - for (let e = 0; e < elements.length; e++) { - // Check if we've stopped at an entity - if (elements[e].token) { - // Examine the consecutive entities, if any. - for (let i = e + 1; i < elements.length; i++) { - // Combine consecutive entities of the same type into one entity. Then, mark the duplicates as 'false'. - if (typeof elements[i] !== 'string' && elements[i].type === elements[e].type) { - elements[e].token += ' ' + elements[i].token; - elements[i] = false; - } - // Stop the loop when we've run out of consecutive entities - if (typeof elements[i] === 'string') { - break; - } - } - } - } - // Filter out the consecutive entities that were marked as duplicates - elements = elements.filter((val: any) => !!val); - // Loop through our 'elements' array. Push strings directly to the 'jsx' array. Convert entity objects to jsx markup, then push to the 'jsx' array. - elements.forEach((t: Span, i: number) => { - if (typeof t === 'string') { - jsx.push( - { - highlightCallback(e, t, i); - }} - onDoubleClick={e => { - highlightCallback(e, t, i); - }} - > - {t} - - ); - } else { - jsx.push( - onClick(e, t, i)} - onMouseOver={e => onMouseOver(e, t, i)} - style={{ - padding: '0.25em 0.35em', - margin: '0px 0.25em', - lineHeight: '1', - display: 'inline-block', - borderRadius: '0.25em', - border: '1px solid', - background: `rgba( - ${findRed(t.type)}, - ${findGreen(t.type)}, - ${findBlue(t.type)}, - 0.2 - )`, - borderColor: `rgb( - ${findRed(t.type)}, - ${findGreen(t.type)}, - ${findBlue(t.type)} - )` - }} - > - {t.token} - onMouseOver(e, t, i)} - style={{ - boxSizing: 'border-box', - fontSize: '0.6em', - lineHeight: '1', - padding: '0.35em', - borderRadius: '0.35em', - display: 'inline-block', - verticalAlign: 'middle', - margin: '0px 0px 0.1rem 0.5rem', - background: `rgb( - ${findRed(t.type)}, - ${findGreen(t.type)}, - ${findBlue(t.type)} - )` - }} - > - {t.type} - - - ); - } - }); - } - - // METHOD 2 - TOKENS - if (Array.isArray(text)) { - // Rename 'text' to 'tokens' for clarity - let tokens = text; - // Loop through the 'spans' array. Use the span data to update our 'tokens' array with entities - for (let s = 0; s < spans.length; s++) { - tokens[spans[s].index] = spans[s]; - tokens[spans[s].index].token = tokens[spans[s].index]; - tokens[spans[s].index].type = spans[s].type; - } - - // Loop through the tokens array, looking for multi-word entities - for (let t = 0; t < tokens.length; t++) { - // Check if we've stopped at an entity - if (tokens[t].token) { - // Examine the consecutive entities, if any. - for (let i = t + 1; i < tokens.length; i++) { - // Combine consecutive entities of the same type into one entity. Then, mark the duplicates as 'false'. - if (typeof tokens[i] !== 'string' && tokens[i].type === tokens[t].type) { - tokens[t].token += ' ' + tokens[i].token; - tokens[i] = false; - } - // Stop the loop when we've run out of consecutive entities - if (typeof tokens[i] === 'string') { - break; - } - } - } - } - // Filter out the consecutive entities that were marked as duplicates - tokens = tokens.filter(val => !!val); - // Add a space to the end of each string/non-entity - let tokensWithSpaces = tokens.map(t => { - if (typeof t === 'string') { - return `${t} `; - } - return t; - }); - // Loop through our 'tokens' array. Push strings directly to the 'jsx' array. Convert entity objects to jsx markup, then push to the 'jsx' array. - tokensWithSpaces.forEach((t, i) => { - if (typeof t === 'string') { - jsx.push( - { - highlightCallback(e, t, i); - }} - onDoubleClick={e => { - highlightCallback(e, t, i); - }} - > - {t} - - ); - } else { - jsx.push( - onClick(e, t, i)} - onMouseOver={e => onMouseOver(e, t, i)} - style={{ - padding: '0.25em 0.35em', - margin: '0px 0.25em', - lineHeight: '1', - display: 'inline-block', - borderRadius: '0.25em', - border: '1px solid', - background: `rgba( - ${findRed(t.type)}, - ${findGreen(t.type)}, - ${findBlue(t.type)}, - 0.2 - )`, - borderColor: `rgb( - ${findRed(t.type)}, - ${findGreen(t.type)}, - ${findBlue(t.type)} - )` - }} - > - {t.token} - onMouseOver(e, t, i)} - style={{ - boxSizing: 'border-box', - fontSize: '0.6em', - lineHeight: '1', - padding: '0.35em', - borderRadius: '0.35em', - display: 'inline-block', - verticalAlign: 'middle', - margin: '0px 0px 0.1rem 0.5rem', - background: `rgb( - ${findRed(t.type)}, - ${findGreen(t.type)}, - ${findBlue(t.type)} - )` - }} - > - {t.type} - - - ); - } - }); - } - - // Return the markup - return ( -
- {jsx.map((j: string, i: number) => ( - {j} - ))} -
- ); -}; - -export default Taggy; diff --git a/astro-frontend/src/components/StyledComponents.tsx b/astro-frontend/src/components/StyledComponents.tsx deleted file mode 100644 index 63736be..0000000 --- a/astro-frontend/src/components/StyledComponents.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; -import {styled} from '@mui/material/styles'; -import {Typography, FormControl} from '@mui/material'; - -// Styled components -export const Paragraph = styled(Typography)(({theme}) => ({ - ...theme.typography.body1, - marginBottom: '8px', - textAlign: 'justify' -})) as typeof Typography; - -export const Title = styled(Typography)(({theme}) => ({ - ...theme.typography.h5, - marginTop: '40px', - marginBottom: '16px', - textAlign: 'center', - fontWeight: '300' -})) as typeof Typography; - -export const FormSettings = styled(FormControl)(({theme}) => ({ - ...theme.components?.MuiFormControl, - width: '100%', - // textAlign: 'center', - '& .MuiFormControl-root': { - marginTop: '8px', - marginBottom: '8px' - }, - '& .MuiFormHelperText-root': { - marginTop: '0px', - marginBottom: '8px' - } -})) as typeof FormControl; - -// export const LinkOut = ({children, ...props}={}) => { -// -// return ( -// {children} -// ) -// } -// export const LinkOut = styled(a)(({ theme }) => ({ -// ...theme.typography.h5, -// marginTop: '40px', -// marginBottom: '16px', -// textAlign: 'center', -// fontWeight: '300', -// })) as typeof Typography; diff --git a/astro-frontend/src/components/UserSettingsPopper.tsx b/astro-frontend/src/components/UserSettingsPopper.tsx deleted file mode 100644 index 42dd9ea..0000000 --- a/astro-frontend/src/components/UserSettingsPopper.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import React from 'react' -import {useTheme} from '@mui/material/styles' -import { - Button, - Tooltip, - Typography, - Popover, - FormControl, - InputLabel, - Select, - MenuItem, - Paper -} from '@mui/material' -import SettingsIcon from '@mui/icons-material/Settings' - -import {useStore} from '@nanostores/react' -import {userSettings} from '../utils/nanostores' - -// TODO: not used yet in astro - -export default function UserSettingsPopper() { - const theme = useTheme() - const $userSettings = useStore(userSettings) - - // Popover settings - const [anchorEl, setAnchorEl] = React.useState(null) - const handleClick = (event: React.MouseEvent) => { - setAnchorEl(event.currentTarget) - } - const handleClose = () => { - setAnchorEl(null) - } - const open = Boolean(anchorEl) - const id = open ? 'simple-popover' : undefined - - return ( -
- - - - - - - Settings - - {/* Dropdown to choose server */} - - Server - - - - -
- ) -} diff --git a/astro-frontend/src/components/shape-publisher/JsonldForm.tsx b/astro-frontend/src/components/shape-publisher/JsonldForm.tsx deleted file mode 100644 index 263b8f4..0000000 --- a/astro-frontend/src/components/shape-publisher/JsonldForm.tsx +++ /dev/null @@ -1,232 +0,0 @@ -import React, {useEffect} from 'react'; - -import {Parser, Store} from 'n3'; -// import { DataFactory, Parser } from 'n3'; - -// import hljs from 'highlight.js/lib/core'; -// import json from 'highlight.js/lib/languages/json'; -// import 'highlight.js/styles/github-dark-dimmed.css'; - -import {shacl2jsonschema} from './shacl2jsonschema'; - -// https://github.com/rjsf-team/react-jsonschema-form/tree/master/packages -// import Form from "@rjsf/core"; -// Requires bootstrap css imported - -// import Form from '@rjsf/material-ui/v5'; -// Can't find module for mui v5 - -import Form from '@rjsf/fluent-ui'; -// import validator from "@rjsf/validator-ajv8"; -// Works! But look like Microsoft UI, and subshapes not distinguishable from parent - -// import Form from '@rjsf/material-ui'; -// Not that nice style, and it breaks other components colors -// import Form from "@rjsf/chakra-ui"; -// Import error in the framer-motion package -// import Form from '@rjsf/semantic-ui'; -// Require to import dirty CSS that makes changes to font sizes -// import Form from '@rjsf/antd'; -// Even when CSS imported it's not really nice -// import Form from '@rjsf/bootstrap-4'; -// Completly broken styles - -// Another library, not working "No renderer found" -// https://jsonforms.io/docs/integrations/react/ -// yarn add @jsonforms/core @jsonforms/material-renderers @jsonforms/react -// import { JsonForms } from '@jsonforms/react'; -// import { materialCells, materialRenderers } from '@jsonforms/material-renderers'; - -type Props = { - shape: string; - target: string; -}; - -export const JsonldForm = ({shape, target}: Props) => { - // - const parser = new Parser(); - const store = new Store(); - - const [state, setState] = React.useState({ - // shape: shape, - store: store, - prefixes: {}, - jsonld: {}, - generatedJsonld: {}, - jsonschema: {}, - jsonErrors: {}, - jsonValid: false, - showJsonld: false, - showJsonSchema: false, - targetClass: '', - showJsonBtnHover: false - }); - - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - useEffect(() => { - // hljs.registerLanguage('json', json); - - // const jsonForm: any = document.getElementById(target); - // // const event = new CustomEvent('change'); - // jsonForm.addEventListener("change", (event: any) => { - // handleChange(event); - // }); - // setTimeout(function() { - // jsonForm.dispatchEvent(event) - // }, 2000); - - console.log('Parsing the SHACL shape to generate the JSON schema'); - parser.parse(shape, (error: any, quad: any, prefixes: any) => { - if (quad) { - store.add(quad); - } else { - console.log('Prefixes:', prefixes); - - const {jsonschema, jsonld, context} = shacl2jsonschema(store, target, prefixes); - - console.log('🏁 Final JSON Schema generated for the SHACL shape:', jsonschema); - updateState({ - prefixes: context, - jsonschema: jsonschema, - jsonld: jsonld - }); - } - }); - }, [shape, target]); - - return ( -
-

- Form generated from the target shape {target} - {/* https://stackoverflow.com/questions/56646500/add-hover-effect-to-react-div-using-inline-styling */} - -

- - {/* Show JSON Schema */} - {state.showJsonSchema && ( -
-          
-            {JSON.stringify(state.jsonschema, null, 2)}
-          
-        
- )} - - {/* TODO: Check peer dependencies, etc - Try React 17: https://github.com/rjsf-team/react-jsonschema-form/issues/2857 */} - - {/* More modern, react and mui based JSON schema form: https://github.com/rjsf-team/react-jsonschema-form/tree/master/packages/material-ui */} - {/* But weird imports v4/v5 for mui not working properly */} - -
-
{ - console.log('changed', event); - // updateState({ - // jsonld: data.formData - // }) - }} - onSubmit={(event: any) => { - // event. - console.log('submitted', event); - updateState({ - jsonld: event.formData, - showJsonld: true, - jsonValid: true - }); - }} - onError={(event: any) => { - console.log('errors', event); - // updateState({ - // jsonErrors: event.errors, - // jsonValid: false, - // }) - }} - /> -
- - {/* https://github.com/eclipsesource/jsonforms-react-seed/blob/master/src/App.tsx */} - {/* { - // console.log(errors) - // updateState({ - // jsonld: data, - // jsonErrors: errors, - // // showJsonld: true, - // // jsonValid: true, - // }) - }} - /> */} - - {/* Show JSON-LD generated */} - {state.showJsonld && state.jsonValid && ( -
-          
-            <>
-              {JSON.stringify(
-                {
-                  '@graph': [{...state.jsonld}],
-                  '@context': state.prefixes
-                },
-                null,
-                2
-              )}
-            
-          
-        
- )} - - {/* Show error JSON not useful with rjsf */} - {/* { state.showJsonld && !state.jsonValid && -
-          
-            {JSON.stringify(state.jsonErrors, null, 2)}
-          
-        
- } */} -
- ); -}; diff --git a/astro-frontend/src/components/shape-publisher/ShapeUploader.tsx b/astro-frontend/src/components/shape-publisher/ShapeUploader.tsx deleted file mode 100644 index 1f577ce..0000000 --- a/astro-frontend/src/components/shape-publisher/ShapeUploader.tsx +++ /dev/null @@ -1,157 +0,0 @@ -import React from 'react'; -import { - IconButton, - Typography, - Button, - FormControl, - TextField, - Card, - CardContent, - CardHeader, - Collapse, - Snackbar, - List, - ListItem, - ListItemAvatar, - Avatar, - ListItemText -} from '@mui/material'; -// QuestionAnswer -import MuiAlert from '@mui/material/Alert'; - -import {FormSettings} from '../StyledComponents'; -import Icon from '../Icon'; - -export default function ShapeUploader({renderObject, shapeTarget, onChange}: any) { - const [state, setState] = React.useState({ - show_info_card: false, - json_error_open: false, - json_loaded_open: false, - shapeFile: renderObject, - shapeTarget: shapeTarget - // shapeFile: JSON.stringify(renderObject, null, 4) - }); - const stateRef = React.useRef(state); - // Avoid conflict when async calls - const updateState = React.useCallback( - (update: any) => { - stateRef.current = {...stateRef.current, ...update}; - setState(stateRef.current); - }, - [setState] - ); - - const handleSubmit = (event: React.FormEvent) => { - event.preventDefault(); - try { - // Call onChange function given by parent - onChange(state.shapeFile, state.shapeTarget); - updateState({...state, json_loaded_open: true}); - } catch (e) { - console.log('Invalid shape'); - updateState({...state, json_error_open: true}); - } - }; - - // Close Snackbar - const closeJsonError = () => { - updateState({...state, json_error_open: false}); - }; - const closeJsonLoaded = () => { - updateState({...state, json_loaded_open: false}); - }; - - return ( - - { - updateState({show_info_card: !state.show_info_card}); - }} - name="show_info_card" - aria-expanded={state.show_info_card} - aria-label="show about" - > - Import  - {!state.show_info_card && } - {state.show_info_card && } - - } - title="Import your shape" - subheader={'Paste your SHACL shape file content in the box, and submit it to generate a form for this shape.'} - /> - - - - - - ) => { - updateState({shapeFile: event.target.value}); - }} - size="small" - InputProps={{ - className: 'input' - }} - InputLabelProps={{required: false}} - /> - - ) => { - updateState({shapeTarget: event.target.value}); - }} - size="small" - InputProps={{ - className: 'input' - }} - InputLabelProps={{required: false}} - /> - -
- -
- - - The shape provided is not valid ❌️ - - - - - The shape has been loaded. - - -
- -
-
-
- ); -} diff --git a/astro-frontend/src/components/shape-publisher/shacl2jsonschema.tsx b/astro-frontend/src/components/shape-publisher/shacl2jsonschema.tsx deleted file mode 100644 index ea01d8a..0000000 --- a/astro-frontend/src/components/shape-publisher/shacl2jsonschema.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import {Store, DataFactory} from 'n3'; - -const {namedNode} = DataFactory; -const shaclNs = 'http://www.w3.org/ns/shacl#'; -const sh = (prop: string) => { - return namedNode(`${shaclNs}${prop}`); -}; - -export const shacl2jsonschema = (store: Store, target: string, context: any, title: any = null) => { - // JSON-LD JSON Schema: https://github.com/json-ld/json-ld.org/blob/main/schemas/jsonld-schema.json - // JSON form from schema: https://www.webcomponents.org/element/json-form-custom-element - // Demo: https://json-tools.github.io/json-form/ - console.log('TARGET of shacl2jsonschema:', target); - const jsonschema: any = { - type: 'object', - properties: {} - }; - if (title) { - jsonschema['title'] = title; - jsonschema['ui'] = {expandable: true}; - } - const jsonld: any = {}; - - // TODO: improve handling of the targetClass (used for the @type) for recursion - const typeProp: any = {enum: []}; - store.getQuads(namedNode(target), sh('targetClass'), null, null).map((targetClassQuad: any) => { - typeProp['title'] = 'Type'; - typeProp['description'] = 'Type of the resource (@type)'; - typeProp['type'] = 'string'; - typeProp['enum'].push(targetClassQuad.object.value.toString()); - typeProp['default'] = targetClassQuad.object.value.toString(); - - console.log('TargetClass for:', target); - console.log('Is:', targetClassQuad.object.value.toString()); - - // typeProp["format"] = "uri" - // typeProp["pattern"] = "^https?://" - jsonld['@type'] = targetClassQuad.object.value.toString(); - - // Disable changes to @type: - // typeProp["ui"] = { - // "rule": { - // "action": "disable", - // "path": "/enabled", - // "condition": { "const": false, "default": false } - // } - // } - }); - jsonschema['properties']['@type'] = typeProp; - - // for (const targetClassQuad of store.getQuads(namedNode(target), sh("targetClass"), null, null)) { - // // targetClass = targetClassQuad.object.value.toString() - // typeProp['title'] = 'Type' - // typeProp['description'] = 'Type of the resource (@type)' - // typeProp["type"] = "string" - // typeProp["enum"].push(targetClassQuad.object.value.toString()) - // typeProp["default"] = targetClassQuad.object.value.toString() - - // // typeProp["format"] = "uri" - // // typeProp["pattern"] = "^https?://" - // jsonld['@type'] = targetClassQuad.object.value.toString() - // // typeProp["ui"] = { "disable": true } - // typeProp["ui"] = { - // "rule": { - // "action": "disable", - // "path": "/enabled", - // "condition": { - // "const": false, - // "default": false - // } - // } - // } - // // ui:readonly - // // updateState({targetClass: targetClassQuad.object.value}) - // } - - // jsonschema["properties"]['@type'] = typeProp - - // Checking every sh:property for the ShapeNode - const requiredProps: any = ['@type']; - for (const propQuad of store.getQuads(namedNode(target), sh('property'), null, null)) { - console.log('Checking property:', propQuad); - const propSubj = propQuad.object; - let propPath = null; - let propSchema: any = {}; - - // Check sh:path - for (const pathQuad of store.getQuads(propSubj, sh('path'), null, null)) { - propPath = pathQuad.object.value; - // console.log("Path of the property:", propPath) - // console.log(pathQuad.termType); // Quad - // console.log(pathQuad.object.language); // en - } - if (!propPath) { - continue; - } - - // Check sh:nodeKind - for (const subProp of store.getQuads(propSubj, sh('nodeKind'), null, null)) { - if (subProp.object.value == `${shaclNs}IRI`) { - propSchema['format'] = 'uri'; - propSchema['pattern'] = '^https?://'; - // if (context) { - // context[propPath] = {'@type': '@id'} - // } else { - // context = {[propPath]: {'@type': '@id'}} - // } - } else { - propSchema['description'] = subProp.object.value; - } - } - - // Check sh:name - for (const subProp of store.getQuads(propQuad.object, sh('name'), null, null)) { - propSchema['title'] = subProp.object.value; - } - // Check sh:description - for (const subProp of store.getQuads(propQuad.object, sh('description'), null, null)) { - propSchema['description'] = subProp.object.value; - } - // Check sh:message (override description if found) - for (const subProp of store.getQuads(propQuad.object, sh('message'), null, null)) { - propSchema['description'] = subProp.object.value; - } - - // Check sh:minCount - let propMinCount = null; - for (const minCountQuad of store.getQuads(propQuad.object, sh('minCount'), null, null)) { - propMinCount = parseInt(minCountQuad.object.value); - if (propMinCount > 0) { - requiredProps.push(propPath); - } - } - // Also check for sh:minInclusive if sh:minCount not found - if (propMinCount === null) { - for (const minCountQuad of store.getQuads(propQuad.object, sh('minInclusive'), null, null)) { - propMinCount = parseInt(minCountQuad.object.value); - if (propMinCount > 0) { - requiredProps.push(propPath); - } - } - } - - // Check sh:datatype (if integer) - for (const subProp of store.getQuads(propQuad.object, sh('datatype'), null, null)) { - if (subProp.object.value.toString() === 'http://www.w3.org/2001/XMLSchema#integer') { - propSchema['type'] = 'number'; - } - } - - // Check if sh:pattern, override the URI pattern if present - for (const subProp of store.getQuads(propQuad.object, sh('pattern'), null, null)) { - propSchema['pattern'] = subProp.object.value; - } - - // Check if other nodes and process them recursively: - for (const subProp of store.getQuads(propQuad.object, sh('node'), null, null)) { - for (const subPropShape of store.getQuads( - subProp.object, - namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), - sh('NodeShape'), - null - )) { - console.log( - `Found a sh:node pointing to another NodeShape: ${subPropShape.subject.value.toString()}, generating nested object in the JSON Schema` - ); - - const subSchema = shacl2jsonschema(store, subPropShape.subject.value.toString(), context, propSchema['title']); - // console.log('subSchema!', subSchema['jsonschema']) - propSchema = subSchema['jsonschema']; - jsonld[propPath] = subSchema['jsonld']; - // propSchema = subSchema['jsonld'] - // json - } - } - - if (!propSchema['type']) { - propSchema['type'] = 'string'; - } - jsonschema['properties'][propPath] = propSchema; - } - jsonschema['required'] = requiredProps; - console.log('One of the JSON Schema generated for the SHACL shape:', jsonschema); - return {jsonschema, jsonld, context}; -}; diff --git a/astro-frontend/src/env.d.ts b/astro-frontend/src/env.d.ts deleted file mode 100644 index 989263c..0000000 --- a/astro-frontend/src/env.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -declare module 'cytoscape-spread'; -declare module 'cytoscape-cose-bilkent'; -declare module 'cytoscape-cola'; diff --git a/astro-frontend/src/layouts/Footer.astro b/astro-frontend/src/layouts/Footer.astro deleted file mode 100644 index 68cb361..0000000 --- a/astro-frontend/src/layouts/Footer.astro +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/astro-frontend/src/layouts/Header.astro b/astro-frontend/src/layouts/Header.astro deleted file mode 100644 index cc3c4d6..0000000 --- a/astro-frontend/src/layouts/Header.astro +++ /dev/null @@ -1,249 +0,0 @@ ---- -import {settings} from '../utils/settings'; -import OrcidLogin from '../components/OrcidLogin'; - -import Icon from '../components/Icon.astro'; - -interface MenuLink { - text?: string; - href?: string; - tooltip?: string; - icon?: string; - img?: string; - cssClass?: string; -} -export interface Props { - leftLinks?: Array; - rightLinks?: Array; -} - -const { - leftLinks = [ - { - text: 'Browse Nanopubs', - tooltip: '🔍️ Browse Nanopublications', - href: `${settings.basePath}/`, - icon: 'search' - }, - { - text: 'Annotate text', - tooltip: '🏷️ Annotate biomedical text, and publish the assertion as Nanopublication', - href: `${settings.basePath}/annotate`, - icon: 'local_offer' - }, - { - text: 'Shape form', - tooltip: '📝 Define and publish RDF nanopublications from SHACL shapes', - href: `${settings.basePath}/shape-publisher`, - icon: 'dynamic_form' - } - ], - - rightLinks = [ - { - text: 'API', - tooltip: '📖 Access the OpenAPI documentation of the API used by this service', - href: settings.docsUrl, - // icon: "search", - img: 'openapi_logo.svg' - }, - { - tooltip: 'ℹ️ About the Knowledge Collaboratory', - href: `${settings.basePath}/about`, - icon: 'info' - }, - { - tooltip: 'Source code on GitHub', - href: 'https://github.com/MaastrichtU-IDS/knowledge-collaboratory', - img: 'github.svg', - cssClass: 'whiteSvgIcon' - } - ] -} = Astro.props; ---- - -
- - - -
-
- -
-
-
- - - - diff --git a/astro-frontend/src/layouts/Layout.astro b/astro-frontend/src/layouts/Layout.astro deleted file mode 100644 index 94b20e0..0000000 --- a/astro-frontend/src/layouts/Layout.astro +++ /dev/null @@ -1,77 +0,0 @@ ---- -import './globals.css'; -import '@fontsource/open-sans/400.css'; - -import Footer from './Footer.astro'; -import Header from './Header.astro'; - -// const theme = createTheme({ -// palette: { -// primary: { light: '#6ec6ff', main: '#2196f3', dark: '#0069c0' }, // blue -// secondary: { light: '#76d275', main: '#43a047', dark: '#00701a' }, // green -// // default: { light: '#fafafa', main: '#eceff1', dark: grey[600] } -// // success: { light: '#ffe0b2', main: '#a5d6a7', dark: '#00600f' }, // green -// // info: { light: '#b3e5fc', main: '#81d4fa', dark: '#00600f' }, // blue -// // warning: { light: '#c8e6c9', main: '#ffcc80', dark: '#00600f' }, // orange -// // error: { light: '#ffcdd2', main: '#ef9a9a', dark: '#e57373' }, // red -// }, -// typography: { -// "fontFamily": "\"Open Sans\", \"Roboto\", \"Arial\"", -// "fontWeightLight": 300, -// "fontWeightRegular": 400, -// "fontWeightMedium": 500, -// "fontSize": 11 -// }, -// }); - -export interface Props { - title: string; -} - -const {title} = Astro.props; ---- - - - - - - - - - - {title} - - - - - - - - - - -
- -
- -
- -
- - - - - diff --git a/astro-frontend/src/layouts/MarkdownLayout.astro b/astro-frontend/src/layouts/MarkdownLayout.astro deleted file mode 100644 index d23d2c2..0000000 --- a/astro-frontend/src/layouts/MarkdownLayout.astro +++ /dev/null @@ -1,17 +0,0 @@ ---- -import Layout from './Layout.astro'; - -export interface Props { - title: string; -} - -const {title} = Astro.props; ---- - - -
-
- -
-
-
diff --git a/astro-frontend/src/layouts/globals.css b/astro-frontend/src/layouts/globals.css deleted file mode 100644 index 9ef1120..0000000 --- a/astro-frontend/src/layouts/globals.css +++ /dev/null @@ -1,156 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0'); - -/* Check colors at https://docusaurus.io/fr/docs/styling-layout#styling-your-site-with-infima */ -:root { - --color-primary-light: #6ec6ff; - --color-primary: #2196f3; - --color-primary-dark: #0069c0; - --color-primary-darker: #12427e; - - --color-secondary-light: #76d275; - --color-secondary: #43a047; - --color-secondary-dark: #00701a; - --color-accent: #43a047; - --color-grey: #c0bfbc; - --color-grey-dark: #5b5b66; - --color-white: #fff; -} - -body { - font-family: 'Roboto', sans-serif; - /* font-family: "Open Sans", "Roboto", sans-serif; */ - margin: 0px; -} -a { - color: var(--color-primary-dark); - text-decoration: none; -} -a:hover { - color: var(--color-primary); - text-decoration: none; -} -h2 { - font-weight: 300; - text-align: center; - margin-top: 0px; - margin-bottom: 16px; -} -p { - font-size: small; -} - -mark { - cursor: pointer; -} -pre { - border: 2px solid grey; - padding: 1em; -} -code { - font-size: 11px; - border-radius: 10px; - padding: 3px; -} -pre, -code { - font-family: monospace, monospace; - border-radius: 6px; - color: #adbac7; - background: #22272e; - /* padding: 5px; */ - /* background-color: #78909c; */ -} - -.flexGrow { - flex-grow: 1; -} -.mainView { - min-height: 100vh; - height: 100%; - width: 100%; - background-color: #eceff1; - display: flex; - flex-basis: auto; - flex-direction: column; - flex-shrink: 0; -} -.mainContainer { - margin-top: 30px; - margin-bottom: 20px; - text-align: left; -} -.mainText { - text-align: 'left'; - margin-bottom: 20px; -} -.markdownContainer { - max-width: 1200px; - text-align: left; - margin: 32px 16px; -} -.markdownContainer h2 { - text-align: left; -} - -.paper { - padding: 16px; -} -.paperMargin { - padding: 16px; - margin: 16px; -} - -/* Get the right filter at https://codepen.io/sosuke/pen/Pjoqqp */ -.whiteSvgIcon { - filter: invert(100%) sepia(0%) saturate(7500%) hue-rotate(345deg) brightness(104%) contrast(107%); -} -/* .whiteSvgIcon:hover { - filter: invert(91%) sepia(1%) saturate(798%) hue-rotate(7deg) brightness(76%) contrast(82%); -} */ - -.button { - text-transform: none; - /* margin: 16px; */ -} -.linkButton { - text-transform: none; - text-decoration: none; - color: #fff; -} -.MuiButton-root.MuiButton-contained { - text-transform: none; -} -.loginButton { - text-transform: none; - text-decoration: none; - padding: 0px; - border: 0; - color: 'inherit'; - border-radius: 8px; -} - -.MuiFormLabel-root.MuiInputLabel-root { - z-index: 100; -} - -.input { - background: #fff; -} - -/* CSS for React JSON schema form (rjsf), it bugs and use the root id for some styling */ -fieldset#root { - display: inline-block; -} -.ms-Grid-col.ms-sm12.field.field-object { - /* margin-left: 16px; */ - margin-bottom: 32px !important; - border-bottom: 1px solid grey; -} - -/* @import url("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"); */ -/* Bootstrap imported for rjsf default (mui bug) */ - -/* Not really using TailwindCSS at the moment, creating too many conflicts with existing styles */ -/* @tailwind base; -@tailwind components; -@tailwind utilities; */ diff --git a/astro-frontend/src/pages/about.md b/astro-frontend/src/pages/about.md deleted file mode 100644 index b3c048d..0000000 --- a/astro-frontend/src/pages/about.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: About the Knowledge Collaboratory -layout: ../layouts/MarkdownLayout.astro ---- - -## ℹ️ About - -The Knowledge Collaboratory is a web service to help annotate biomedical text, query and publish [Nanopublications](https://nanopub.net/) for the [NIH NCATS Biomedical Data Translator project](https://ncats.nih.gov/translator). It provide the following functionalities: - -🔎 **Browse Nanopublications** through the web UI, or query them using the [Translator Reasoner API (TRAPI) specifications](https://github.com/NCATSTranslator/ReasonerAPI). - -✒️ **Annotate biomedical text** and publish the annotations as nanopublications after login with your [ORCID](https://orcid.org/). - -This service is developed by the [Institute of Data Science](https://www.maastrichtuniversity.nl/research/institute-data-science) at Maastricht University in collaboration with the NCATS Translator project. - -## ⚙️ How it works - -The Knowledge Collaboratory consists in an OpenAPI service and a user-friendly web UI to query the Nanopublications network, store Nanopublication authentication keys, and publish Nanopublications. - -🗄️ **Backend API**: an OpenAPI built with Python and FastAPI, to store the keys on the server, and run the process to publish a Nanopublication. - -🌐 **Webapp frontend**: a website built with TypeScript, ReactJS and Astro, to provide a user-friendly access to the Nanopublication network. diff --git a/astro-frontend/src/pages/annotate.astro b/astro-frontend/src/pages/annotate.astro deleted file mode 100644 index 29b68f9..0000000 --- a/astro-frontend/src/pages/annotate.astro +++ /dev/null @@ -1,8 +0,0 @@ ---- -import Layout from '../layouts/Layout.astro'; -import PageAnnotate from '../app/PageAnnotate'; ---- - - - - diff --git a/astro-frontend/src/pages/index.astro b/astro-frontend/src/pages/index.astro deleted file mode 100644 index 2f1a615..0000000 --- a/astro-frontend/src/pages/index.astro +++ /dev/null @@ -1,8 +0,0 @@ ---- -import Layout from '../layouts/Layout.astro'; -import PageBrowse from '../app/PageBrowse'; ---- - - - - diff --git a/astro-frontend/src/pages/shape-publisher.astro b/astro-frontend/src/pages/shape-publisher.astro deleted file mode 100644 index 02dac30..0000000 --- a/astro-frontend/src/pages/shape-publisher.astro +++ /dev/null @@ -1,8 +0,0 @@ ---- -import Layout from '../layouts/Layout.astro'; -import ShapePublisher from '../app/PageShapePublisher'; ---- - - - - diff --git a/astro-frontend/src/utils/biolinkModel.ts b/astro-frontend/src/utils/biolinkModel.ts deleted file mode 100644 index 935942b..0000000 --- a/astro-frontend/src/utils/biolinkModel.ts +++ /dev/null @@ -1,2896 +0,0 @@ -const BIOLINK = 'https://w3id.org/biolink/vocab/'; -// const IDO = 'https://identifiers.org/' -// const RDFS = 'http://www.w3.org/2000/01/rdf-schema#' - -// TODO: complete the list of ents? -// RGB colors: https://www.rapidtables.com/web/color/RGB_Color.html -export const ents = [ - { - type: 'Association', - label: 'Association', - id: BIOLINK + 'Association', - curie: 'biolink:Association', - color: {r: 67, g: 198, b: 252} - }, // Light blue - { - type: 'ChemicalEntity', - label: 'Chemical Entity', - id: BIOLINK + 'ChemicalEntity', - curie: 'biolink:ChemicalEntity', - color: {r: 255, g: 178, b: 102} - }, // Orange - {type: 'Drug', label: 'Drug', id: BIOLINK + 'Drug', curie: 'biolink:Drug', color: {r: 255, g: 102, b: 102}}, // Red - { - type: 'DiseaseOrPhenotypicFeature', - label: 'Disease or Phenotypic Feature', - id: BIOLINK + 'DiseaseOrPhenotypicFeature', - curie: 'biolink:DiseaseOrPhenotypicFeature', - color: {r: 47, g: 187, b: 171} - }, // Blue green - { - type: 'Disease', - label: 'Disease', - id: BIOLINK + 'Disease', - curie: 'biolink:Disease', - color: {r: 47, g: 187, b: 171} - }, // Blue green - { - type: 'GeneOrGeneProduct', - label: 'Gene or Gene Product', - id: BIOLINK + 'GeneOrGeneProduct', - curie: 'biolink:GeneOrGeneProduct', - color: {r: 218, g: 112, b: 214} - }, // Purple - { - type: 'GeneProduct', - label: 'Gene Product', - id: BIOLINK + 'GeneProduct', - curie: 'biolink:GeneProduct', - color: {r: 218, g: 112, b: 214} - }, // Purple - { - type: 'SequenceVariant', - label: 'Sequence Variant', - id: BIOLINK + 'SequenceVariant', - curie: 'biolink:SequenceVariant', - color: {r: 166, g: 226, b: 45} - }, // Light green - {type: 'Cohort', label: 'Cohort', id: BIOLINK + 'Cohort', curie: 'biolink:Cohort', color: {r: 204, g: 204, b: 0}}, // Yellow - { - type: 'StudyPopulation', - label: 'Study Population', - id: BIOLINK + 'StudyPopulation', - curie: 'biolink:StudyPopulation', - color: {r: 204, g: 204, b: 0} - }, // Yellow - { - type: 'PopulationOfIndividualOrganisms', - label: 'Population of Individual Organisms ', - id: BIOLINK + 'PopulationOfIndividualOrganisms ', - curie: 'biolink:PopulationOfIndividualOrganisms ', - color: {r: 204, g: 204, b: 0} - }, // Yellow - { - type: 'OrganismTaxon', - label: 'Organism Taxon', - id: BIOLINK + 'OrganismTaxon', - curie: 'biolink:OrganismTaxon', - color: {r: 204, g: 204, b: 0} - }, // Yellow - { - type: 'NamedEntity', - label: 'NamedEntity', - id: BIOLINK + 'NamedEntity', - curie: 'biolink:NamedEntity', - color: {r: 255, g: 102, b: 102} - } // Red -]; - -// https://biolink.github.io/biolink-model/docs/predicates.html -export const predicatesList = [ - {id: 'https://w3id.org/biolink/vocab/treats', curie: 'biolink:treats', label: 'Treats', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/treated_by', curie: 'biolink:treated_by', label: 'Treated by', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/interacts_with', - curie: 'biolink:interacts_with', - label: 'Interacts with', - type: 'BioLink' - }, - - { - id: 'https://w3id.org/biolink/vocab/abundance_affected_by', - curie: 'biolink:abundance_affected_by', - label: 'abundance affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/abundance_decreased_by', - curie: 'biolink:abundance_decreased_by', - label: 'abundance decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/abundance_increased_by', - curie: 'biolink:abundance_increased_by', - label: 'abundance increased by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/active_in', curie: 'biolink:active_in', label: 'active in', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/actively_involved_in', - curie: 'biolink:actively_involved_in', - label: 'actively involved in', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/actively_involves', - curie: 'biolink:actively_involves', - label: 'actively involves', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/activity_affected_by', - curie: 'biolink:activity_affected_by', - label: 'activity affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/activity_decreased_by', - curie: 'biolink:activity_decreased_by', - label: 'activity decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/activity_increased_by', - curie: 'biolink:activity_increased_by', - label: 'activity increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/acts_upstream_of', - curie: 'biolink:acts_upstream_of', - label: 'acts upstream of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/acts_upstream_of_negative_effect', - curie: 'biolink:acts_upstream_of_negative_effect', - label: 'acts upstream of negative effect', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/acts_upstream_of_or_within', - curie: 'biolink:acts_upstream_of_or_within', - label: 'acts upstream of or within', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/acts_upstream_of_or_within_negative_effect', - curie: 'biolink:acts_upstream_of_or_within_negative_effect', - label: 'acts upstream of or within negative effect', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/acts_upstream_of_or_within_positive_effect', - curie: 'biolink:acts_upstream_of_or_within_positive_effect', - label: 'acts upstream of or within positive effect', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/acts_upstream_of_positive_effect', - curie: 'biolink:acts_upstream_of_positive_effect', - label: 'acts upstream of positive effect', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/adverse_event_caused_by', - curie: 'biolink:adverse_event_caused_by', - label: 'adverse event caused by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affected_by', - curie: 'biolink:affected_by', - label: 'affected by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/affects', curie: 'biolink:affects', label: 'affects', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/affects_abundance_of', - curie: 'biolink:affects_abundance_of', - label: 'affects abundance of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_activity_of', - curie: 'biolink:affects_activity_of', - label: 'affects activity of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_degradation_of', - curie: 'biolink:affects_degradation_of', - label: 'affects degradation of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_expression_in', - curie: 'biolink:affects_expression_in', - label: 'affects expression in', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_expression_of', - curie: 'biolink:affects_expression_of', - label: 'affects expression of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_folding_of', - curie: 'biolink:affects_folding_of', - label: 'affects folding of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_localization_of', - curie: 'biolink:affects_localization_of', - label: 'affects localization of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_metabolic_processing_of', - curie: 'biolink:affects_metabolic_processing_of', - label: 'affects metabolic processing of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_molecular_modification_of', - curie: 'biolink:affects_molecular_modification_of', - label: 'affects molecular modification of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_mutation_rate_of', - curie: 'biolink:affects_mutation_rate_of', - label: 'affects mutation rate of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_response_to', - curie: 'biolink:affects_response_to', - label: 'affects response to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_risk_for', - curie: 'biolink:affects_risk_for', - label: 'affects risk for', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_secretion_of', - curie: 'biolink:affects_secretion_of', - label: 'affects secretion of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_splicing_of', - curie: 'biolink:affects_splicing_of', - label: 'affects splicing of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_stability_of', - curie: 'biolink:affects_stability_of', - label: 'affects stability of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_synthesis_of', - curie: 'biolink:affects_synthesis_of', - label: 'affects synthesis of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_transport_of', - curie: 'biolink:affects_transport_of', - label: 'affects transport of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/affects_uptake_of', - curie: 'biolink:affects_uptake_of', - label: 'affects uptake of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/ameliorates', - curie: 'biolink:ameliorates', - label: 'ameliorates', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/approved_for_treatment_by', - curie: 'biolink:approved_for_treatment_by', - label: 'approved for treatment by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/approved_to_treat', - curie: 'biolink:approved_to_treat', - label: 'approved to treat', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/associated_with', - curie: 'biolink:associated_with', - label: 'associated with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/associated_with_resistance_to', - curie: 'biolink:associated_with_resistance_to', - label: 'associated with resistance to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/associated_with_sensitivity_to', - curie: 'biolink:associated_with_sensitivity_to', - label: 'associated with sensitivity to', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/author', curie: 'biolink:author', label: 'author', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/biomarker_for', - curie: 'biolink:biomarker_for', - label: 'biomarker for', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/broad_match', - curie: 'biolink:broad_match', - label: 'broad match', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/capability_of', - curie: 'biolink:capability_of', - label: 'capability of', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/capable_of', curie: 'biolink:capable_of', label: 'capable of', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/catalyzes', curie: 'biolink:catalyzes', label: 'catalyzes', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/caused_by', curie: 'biolink:caused_by', label: 'caused by', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/causes', curie: 'biolink:causes', label: 'causes', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/causes_adverse_event', - curie: 'biolink:causes_adverse_event', - label: 'causes adverse event', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/chemically_interacts_with', - curie: 'biolink:chemically_interacts_with', - label: 'chemically interacts with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/chemically_similar_to', - curie: 'biolink:chemically_similar_to', - label: 'chemically similar to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/close_match', - curie: 'biolink:close_match', - label: 'close match', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/coexists_with', - curie: 'biolink:coexists_with', - label: 'coexists with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/coexpressed_with', - curie: 'biolink:coexpressed_with', - label: 'coexpressed with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/colocalizes_with', - curie: 'biolink:colocalizes_with', - label: 'colocalizes with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/completed_by', - curie: 'biolink:completed_by', - label: 'completed by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/composed_primarily_of', - curie: 'biolink:composed_primarily_of', - label: 'composed primarily of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/condition_associated_with_gene', - curie: 'biolink:condition_associated_with_gene', - label: 'condition associated with gene', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/consumed_by', - curie: 'biolink:consumed_by', - label: 'consumed by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/consumes', curie: 'biolink:consumes', label: 'consumes', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/contains_process', - curie: 'biolink:contains_process', - label: 'contains process', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/contraindicated_for', - curie: 'biolink:contraindicated_for', - label: 'contraindicated for', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/contributes_to', - curie: 'biolink:contributes_to', - label: 'contributes to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/contribution_from', - curie: 'biolink:contribution_from', - label: 'contribution from', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/contributor', - curie: 'biolink:contributor', - label: 'contributor', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/correlated_with', - curie: 'biolink:correlated_with', - label: 'correlated with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreased_amount_in', - curie: 'biolink:decreased_amount_in', - label: 'decreased amount in', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_abundance_of', - curie: 'biolink:decreases_abundance_of', - label: 'decreases abundance of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_activity_of', - curie: 'biolink:decreases_activity_of', - label: 'decreases activity of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_degradation_of', - curie: 'biolink:decreases_degradation_of', - label: 'decreases degradation of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_expression_of', - curie: 'biolink:decreases_expression_of', - label: 'decreases expression of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_folding_of', - curie: 'biolink:decreases_folding_of', - label: 'decreases folding of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_localization_of', - curie: 'biolink:decreases_localization_of', - label: 'decreases localization of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_metabolic_processing_of', - curie: 'biolink:decreases_metabolic_processing_of', - label: 'decreases metabolic processing of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_molecular_interaction', - curie: 'biolink:decreases_molecular_interaction', - label: 'decreases molecular interaction', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_molecular_modification_of', - curie: 'biolink:decreases_molecular_modification_of', - label: 'decreases molecular modification of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_mutation_rate_of', - curie: 'biolink:decreases_mutation_rate_of', - label: 'decreases mutation rate of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_response_to', - curie: 'biolink:decreases_response_to', - label: 'decreases response to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_secretion_of', - curie: 'biolink:decreases_secretion_of', - label: 'decreases secretion of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_splicing_of', - curie: 'biolink:decreases_splicing_of', - label: 'decreases splicing of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_stability_of', - curie: 'biolink:decreases_stability_of', - label: 'decreases stability of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_synthesis_of', - curie: 'biolink:decreases_synthesis_of', - label: 'decreases synthesis of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_transport_of', - curie: 'biolink:decreases_transport_of', - label: 'decreases transport of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/decreases_uptake_of', - curie: 'biolink:decreases_uptake_of', - label: 'decreases uptake of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/degradation_affected_by', - curie: 'biolink:degradation_affected_by', - label: 'degradation affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/degradation_decreased_by', - curie: 'biolink:degradation_decreased_by', - label: 'degradation decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/degradation_increased_by', - curie: 'biolink:degradation_increased_by', - label: 'degradation increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/derives_from', - curie: 'biolink:derives_from', - label: 'derives from', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/derives_into', - curie: 'biolink:derives_into', - label: 'derives into', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/develops_from', - curie: 'biolink:develops_from', - label: 'develops from', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/develops_into', - curie: 'biolink:develops_into', - label: 'develops into', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/diagnoses', curie: 'biolink:diagnoses', label: 'diagnoses', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/directly_interacts_with', - curie: 'biolink:directly_interacts_with', - label: 'directly interacts with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/disease_has_basis_in', - curie: 'biolink:disease_has_basis_in', - label: 'disease has basis in', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/disease_has_location', - curie: 'biolink:disease_has_location', - label: 'disease has location', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/disrupted_by', - curie: 'biolink:disrupted_by', - label: 'disrupted by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/disrupts', curie: 'biolink:disrupts', label: 'disrupts', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/editor', curie: 'biolink:editor', label: 'editor', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/enabled_by', curie: 'biolink:enabled_by', label: 'enabled by', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/enables', curie: 'biolink:enables', label: 'enables', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/entity_negatively_regulated_by_entity', - curie: 'biolink:entity_negatively_regulated_by_entity', - label: 'entity negatively regulated by entity', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/entity_negatively_regulates_entity', - curie: 'biolink:entity_negatively_regulates_entity', - label: 'entity negatively regulates entity', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/entity_positively_regulated_by_entity', - curie: 'biolink:entity_positively_regulated_by_entity', - label: 'entity positively regulated by entity', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/entity_positively_regulates_entity', - curie: 'biolink:entity_positively_regulates_entity', - label: 'entity positively regulates entity', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/entity_regulated_by_entity', - curie: 'biolink:entity_regulated_by_entity', - label: 'entity regulated by entity', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/entity_regulates_entity', - curie: 'biolink:entity_regulates_entity', - label: 'entity regulates entity', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/exacerbates', - curie: 'biolink:exacerbates', - label: 'exacerbates', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/exact_match', - curie: 'biolink:exact_match', - label: 'exact match', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/expressed_in', - curie: 'biolink:expressed_in', - label: 'expressed in', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/expresses', curie: 'biolink:expresses', label: 'expresses', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/expression_affected_by', - curie: 'biolink:expression_affected_by', - label: 'expression affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/expression_decreased_by', - curie: 'biolink:expression_decreased_by', - label: 'expression decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/expression_increased_by', - curie: 'biolink:expression_increased_by', - label: 'expression increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/folding_affected_by', - curie: 'biolink:folding_affected_by', - label: 'folding affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/folding_decreased_by', - curie: 'biolink:folding_decreased_by', - label: 'folding decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/folding_increased_by', - curie: 'biolink:folding_increased_by', - label: 'folding increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/food_component_of', - curie: 'biolink:food_component_of', - label: 'food component of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/gene_associated_with_condition', - curie: 'biolink:gene_associated_with_condition', - label: 'gene associated with condition', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/gene_product_of', - curie: 'biolink:gene_product_of', - label: 'gene product of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/genetic_association', - curie: 'biolink:genetic_association', - label: 'genetic association', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/genetically_interacts_with', - curie: 'biolink:genetically_interacts_with', - label: 'genetically interacts with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_active_ingredient', - curie: 'biolink:has_active_ingredient', - label: 'has active ingredient', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_biomarker', - curie: 'biolink:has_biomarker', - label: 'has biomarker', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_catalyst', - curie: 'biolink:has_catalyst', - label: 'has catalyst', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_completed', - curie: 'biolink:has_completed', - label: 'has completed', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_contraindication', - curie: 'biolink:has_contraindication', - label: 'has contraindication', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_decreased_amount', - curie: 'biolink:has_decreased_amount', - label: 'has decreased amount', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_excipient', - curie: 'biolink:has_excipient', - label: 'has excipient', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_food_component', - curie: 'biolink:has_food_component', - label: 'has food component', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_frameshift_variant', - curie: 'biolink:has_frameshift_variant', - label: 'has frameshift variant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_gene_product', - curie: 'biolink:has_gene_product', - label: 'has gene product', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_increased_amount', - curie: 'biolink:has_increased_amount', - label: 'has increased amount', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/has_input', curie: 'biolink:has_input', label: 'has input', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/has_manifestation', - curie: 'biolink:has_manifestation', - label: 'has manifestation', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_metabolite', - curie: 'biolink:has_metabolite', - label: 'has metabolite', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_missense_variant', - curie: 'biolink:has_missense_variant', - label: 'has missense variant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_molecular_consequence', - curie: 'biolink:has_molecular_consequence', - label: 'has molecular consequence', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_nearby_variant', - curie: 'biolink:has_nearby_variant', - label: 'has nearby variant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_negative_upstream_actor', - curie: 'biolink:has_negative_upstream_actor', - label: 'has negative upstream actor', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_negative_upstream_or_within_actor', - curie: 'biolink:has_negative_upstream_or_within_actor', - label: 'has negative upstream or within actor', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_non_coding_variant', - curie: 'biolink:has_non_coding_variant', - label: 'has non coding variant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_nonsense_variant', - curie: 'biolink:has_nonsense_variant', - label: 'has nonsense variant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_not_completed', - curie: 'biolink:has_not_completed', - label: 'has not completed', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_nutrient', - curie: 'biolink:has_nutrient', - label: 'has nutrient', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/has_output', curie: 'biolink:has_output', label: 'has output', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/has_part', curie: 'biolink:has_part', label: 'has part', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/has_participant', - curie: 'biolink:has_participant', - label: 'has participant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_phenotype', - curie: 'biolink:has_phenotype', - label: 'has phenotype', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_plasma_membrane_part', - curie: 'biolink:has_plasma_membrane_part', - label: 'has plasma membrane part', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_positive_upstream_actor', - curie: 'biolink:has_positive_upstream_actor', - label: 'has positive upstream actor', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_positive_upstream_or_within_actor', - curie: 'biolink:has_positive_upstream_or_within_actor', - label: 'has positive upstream or within actor', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_real_world_evidence_of_association_with', - curie: 'biolink:has_real_world_evidence_of_association_with', - label: 'has real world evidence of association with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_sequence_location', - curie: 'biolink:has_sequence_location', - label: 'has sequence location', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_sequence_variant', - curie: 'biolink:has_sequence_variant', - label: 'has sequence variant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_splice_site_variant', - curie: 'biolink:has_splice_site_variant', - label: 'has splice site variant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_substrate', - curie: 'biolink:has_substrate', - label: 'has substrate', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_synonymous_variant', - curie: 'biolink:has_synonymous_variant', - label: 'has synonymous variant', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_upstream_actor', - curie: 'biolink:has_upstream_actor', - label: 'has upstream actor', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_upstream_or_within_actor', - curie: 'biolink:has_upstream_or_within_actor', - label: 'has upstream or within actor', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_variant_part', - curie: 'biolink:has_variant_part', - label: 'has variant part', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/homologous_to', - curie: 'biolink:homologous_to', - label: 'homologous to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/in_cell_population_with', - curie: 'biolink:in_cell_population_with', - label: 'in cell population with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/in_complex_with', - curie: 'biolink:in_complex_with', - label: 'in complex with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/in_linkage_disequilibrium_with', - curie: 'biolink:in_linkage_disequilibrium_with', - label: 'in linkage disequilibrium with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/in_pathway_with', - curie: 'biolink:in_pathway_with', - label: 'in pathway with', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/in_taxon', curie: 'biolink:in_taxon', label: 'in taxon', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/increased_amount_of', - curie: 'biolink:increased_amount_of', - label: 'increased amount of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_abundance_of', - curie: 'biolink:increases_abundance_of', - label: 'increases abundance of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_activity_of', - curie: 'biolink:increases_activity_of', - label: 'increases activity of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_degradation_of', - curie: 'biolink:increases_degradation_of', - label: 'increases degradation of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_expression_of', - curie: 'biolink:increases_expression_of', - label: 'increases expression of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_folding_of', - curie: 'biolink:increases_folding_of', - label: 'increases folding of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_localization_of', - curie: 'biolink:increases_localization_of', - label: 'increases localization of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_metabolic_processing_of', - curie: 'biolink:increases_metabolic_processing_of', - label: 'increases metabolic processing of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_molecular_interaction', - curie: 'biolink:increases_molecular_interaction', - label: 'increases molecular interaction', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_molecular_modification_of', - curie: 'biolink:increases_molecular_modification_of', - label: 'increases molecular modification of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_mutation_rate_of', - curie: 'biolink:increases_mutation_rate_of', - label: 'increases mutation rate of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_response_to', - curie: 'biolink:increases_response_to', - label: 'increases response to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_secretion_of', - curie: 'biolink:increases_secretion_of', - label: 'increases secretion of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_splicing_of', - curie: 'biolink:increases_splicing_of', - label: 'increases splicing of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_stability_of', - curie: 'biolink:increases_stability_of', - label: 'increases stability of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_synthesis_of', - curie: 'biolink:increases_synthesis_of', - label: 'increases synthesis of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_transport_of', - curie: 'biolink:increases_transport_of', - label: 'increases transport of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/increases_uptake_of', - curie: 'biolink:increases_uptake_of', - label: 'increases uptake of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_active_ingredient_of', - curie: 'biolink:is_active_ingredient_of', - label: 'is active ingredient of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_diagnosed_by', - curie: 'biolink:is_diagnosed_by', - label: 'is diagnosed by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_excipient_of', - curie: 'biolink:is_excipient_of', - label: 'is excipient of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_frameshift_variant_of', - curie: 'biolink:is_frameshift_variant_of', - label: 'is frameshift variant of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_input_of', - curie: 'biolink:is_input_of', - label: 'is input of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_metabolite_of', - curie: 'biolink:is_metabolite_of', - label: 'is metabolite of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_missense_variant_of', - curie: 'biolink:is_missense_variant_of', - label: 'is missense variant of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_molecular_consequence_of', - curie: 'biolink:is_molecular_consequence_of', - label: 'is molecular consequence of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_nearby_variant_of', - curie: 'biolink:is_nearby_variant_of', - label: 'is nearby variant of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_non_coding_variant_of', - curie: 'biolink:is_non_coding_variant_of', - label: 'is non coding variant of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_nonsense_variant_of', - curie: 'biolink:is_nonsense_variant_of', - label: 'is nonsense variant of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_output_of', - curie: 'biolink:is_output_of', - label: 'is output of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_sequence_variant_of', - curie: 'biolink:is_sequence_variant_of', - label: 'is sequence variant of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_splice_site_variant_of', - curie: 'biolink:is_splice_site_variant_of', - label: 'is splice site variant of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_substrate_of', - curie: 'biolink:is_substrate_of', - label: 'is substrate of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/is_synonymous_variant_of', - curie: 'biolink:is_synonymous_variant_of', - label: 'is synonymous variant of', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/lacks_part', curie: 'biolink:lacks_part', label: 'lacks part', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/localization_affected_by', - curie: 'biolink:localization_affected_by', - label: 'localization affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/localization_decreased_by', - curie: 'biolink:localization_decreased_by', - label: 'localization decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/localization_increased_by', - curie: 'biolink:localization_increased_by', - label: 'localization increased by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/located_in', curie: 'biolink:located_in', label: 'located in', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/location_of', - curie: 'biolink:location_of', - label: 'location of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/manifestation_of', - curie: 'biolink:manifestation_of', - label: 'manifestation of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/mentioned_by', - curie: 'biolink:mentioned_by', - label: 'mentioned by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/mentions', curie: 'biolink:mentions', label: 'mentions', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/metabolic_processing_affected_by', - curie: 'biolink:metabolic_processing_affected_by', - label: 'metabolic processing affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/metabolic_processing_decreased_by', - curie: 'biolink:metabolic_processing_decreased_by', - label: 'metabolic processing decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/metabolic_processing_increased_by', - curie: 'biolink:metabolic_processing_increased_by', - label: 'metabolic processing increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/missing_from', - curie: 'biolink:missing_from', - label: 'missing from', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/model_of', curie: 'biolink:model_of', label: 'model of', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/models', curie: 'biolink:models', label: 'models', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/molecular_interaction_decreased_by', - curie: 'biolink:molecular_interaction_decreased_by', - label: 'molecular interaction decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/molecular_interaction_increased_by', - curie: 'biolink:molecular_interaction_increased_by', - label: 'molecular interaction increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/molecular_modification_affected_by', - curie: 'biolink:molecular_modification_affected_by', - label: 'molecular modification affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/molecular_modification_decreased_by', - curie: 'biolink:molecular_modification_decreased_by', - label: 'molecular modification decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/molecular_modification_increased_by', - curie: 'biolink:molecular_modification_increased_by', - label: 'molecular modification increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/molecularly_interacts_with', - curie: 'biolink:molecularly_interacts_with', - label: 'molecularly interacts with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/mutation_rate_affected_by', - curie: 'biolink:mutation_rate_affected_by', - label: 'mutation rate affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/mutation_rate_decreased_by', - curie: 'biolink:mutation_rate_decreased_by', - label: 'mutation rate decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/mutation_rate_increased_by', - curie: 'biolink:mutation_rate_increased_by', - label: 'mutation rate increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/narrow_match', - curie: 'biolink:narrow_match', - label: 'narrow match', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/negatively_correlated_with', - curie: 'biolink:negatively_correlated_with', - label: 'negatively correlated with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/not_completed_by', - curie: 'biolink:not_completed_by', - label: 'not completed by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/nutrient_of', - curie: 'biolink:nutrient_of', - label: 'nutrient of', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/occurs_in', curie: 'biolink:occurs_in', label: 'occurs in', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/occurs_together_in_literature_with', - curie: 'biolink:occurs_together_in_literature_with', - label: 'occurs together in literature with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/opposite_of', - curie: 'biolink:opposite_of', - label: 'opposite of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/orthologous_to', - curie: 'biolink:orthologous_to', - label: 'orthologous to', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/overlaps', curie: 'biolink:overlaps', label: 'overlaps', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/paralogous_to', - curie: 'biolink:paralogous_to', - label: 'paralogous to', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/part_of', curie: 'biolink:part_of', label: 'part of', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/participates_in', - curie: 'biolink:participates_in', - label: 'participates in', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/phenotype_of', - curie: 'biolink:phenotype_of', - label: 'phenotype of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/physically_interacts_with', - curie: 'biolink:physically_interacts_with', - label: 'physically interacts with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/plasma_membrane_part_of', - curie: 'biolink:plasma_membrane_part_of', - label: 'plasma membrane part of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/positively_correlated_with', - curie: 'biolink:positively_correlated_with', - label: 'positively correlated with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/preceded_by', - curie: 'biolink:preceded_by', - label: 'preceded by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/precedes', curie: 'biolink:precedes', label: 'precedes', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/predisposes', - curie: 'biolink:predisposes', - label: 'predisposes', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/prevented_by', - curie: 'biolink:prevented_by', - label: 'prevented by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/prevents', curie: 'biolink:prevents', label: 'prevents', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/process_negatively_regulated_by_process', - curie: 'biolink:process_negatively_regulated_by_process', - label: 'process negatively regulated by process', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/process_negatively_regulates_process', - curie: 'biolink:process_negatively_regulates_process', - label: 'process negatively regulates process', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/process_positively_regulated_by_process', - curie: 'biolink:process_positively_regulated_by_process', - label: 'process positively regulated by process', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/process_positively_regulates_process', - curie: 'biolink:process_positively_regulates_process', - label: 'process positively regulates process', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/process_regulated_by_process', - curie: 'biolink:process_regulated_by_process', - label: 'process regulated by process', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/process_regulates_process', - curie: 'biolink:process_regulates_process', - label: 'process regulates process', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/produced_by', - curie: 'biolink:produced_by', - label: 'produced by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/produces', curie: 'biolink:produces', label: 'produces', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/provider', curie: 'biolink:provider', label: 'provider', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/publisher', curie: 'biolink:publisher', label: 'publisher', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/related_condition', - curie: 'biolink:related_condition', - label: 'related condition', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/related_to', curie: 'biolink:related_to', label: 'related to', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/related_to_at_concept_level', - curie: 'biolink:related_to_at_concept_level', - label: 'related to at concept level', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/related_to_at_instance_level', - curie: 'biolink:related_to_at_instance_level', - label: 'related to at instance level', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/resistance_associated_with', - curie: 'biolink:resistance_associated_with', - label: 'resistance associated with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/response_affected_by', - curie: 'biolink:response_affected_by', - label: 'response affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/response_decreased_by', - curie: 'biolink:response_decreased_by', - label: 'response decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/response_increased_by', - curie: 'biolink:response_increased_by', - label: 'response increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/risk_affected_by', - curie: 'biolink:risk_affected_by', - label: 'risk affected by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/same_as', curie: 'biolink:same_as', label: 'same as', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/secretion_affected_by', - curie: 'biolink:secretion_affected_by', - label: 'secretion affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/secretion_decreased_by', - curie: 'biolink:secretion_decreased_by', - label: 'secretion decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/secretion_increased_by', - curie: 'biolink:secretion_increased_by', - label: 'secretion increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/sensitivity_associated_with', - curie: 'biolink:sensitivity_associated_with', - label: 'sensitivity associated with', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/sequence_location_of', - curie: 'biolink:sequence_location_of', - label: 'sequence location of', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/similar_to', curie: 'biolink:similar_to', label: 'similar to', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/splicing_affected_by', - curie: 'biolink:splicing_affected_by', - label: 'splicing affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/splicing_decreased_by', - curie: 'biolink:splicing_decreased_by', - label: 'splicing decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/splicing_increased_by', - curie: 'biolink:splicing_increased_by', - label: 'splicing increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/stability_affected_by', - curie: 'biolink:stability_affected_by', - label: 'stability affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/stability_decreased_by', - curie: 'biolink:stability_decreased_by', - label: 'stability decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/stability_increased_by', - curie: 'biolink:stability_increased_by', - label: 'stability increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/subclass_of', - curie: 'biolink:subclass_of', - label: 'subclass of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/superclass_of', - curie: 'biolink:superclass_of', - label: 'superclass of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/synthesis_affected_by', - curie: 'biolink:synthesis_affected_by', - label: 'synthesis affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/synthesis_decreased_by', - curie: 'biolink:synthesis_decreased_by', - label: 'synthesis decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/synthesis_increased_by', - curie: 'biolink:synthesis_increased_by', - label: 'synthesis increased by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/taxon_of', curie: 'biolink:taxon_of', label: 'taxon of', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/temporally_related_to', - curie: 'biolink:temporally_related_to', - label: 'temporally related to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/transcribed_from', - curie: 'biolink:transcribed_from', - label: 'transcribed from', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/transcribed_to', - curie: 'biolink:transcribed_to', - label: 'transcribed to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/translates_to', - curie: 'biolink:translates_to', - label: 'translates to', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/translation_of', - curie: 'biolink:translation_of', - label: 'translation of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/transport_affected_by', - curie: 'biolink:transport_affected_by', - label: 'transport affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/transport_decreased_by', - curie: 'biolink:transport_decreased_by', - label: 'transport decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/transport_increased_by', - curie: 'biolink:transport_increased_by', - label: 'transport increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/uptake_affected_by', - curie: 'biolink:uptake_affected_by', - label: 'uptake affected by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/uptake_decreased_by', - curie: 'biolink:uptake_decreased_by', - label: 'uptake decreased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/uptake_increased_by', - curie: 'biolink:uptake_increased_by', - label: 'uptake increased by', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/variant_part_of', - curie: 'biolink:variant_part_of', - label: 'variant part of', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/xenologous_to', - curie: 'biolink:xenologous_to', - label: 'xenologous to', - type: 'BioLink' - } -]; - -// https://biolink.github.io/biolink-model/docs/edge_properties.html -export const propertiesList = [ - {id: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#subject', curie: 'rdf:subject', label: 'Subject', type: 'RDF'}, - {id: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate', curie: 'rdf:predicate', label: 'Predicate', type: 'RDF'}, - {id: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#subject', curie: 'rdf:object', label: 'Object', type: 'RDF'}, - { - id: 'https://w3id.org/biolink/vocab/population_context_qualifier', - curie: 'biolink:population_context_qualifier', - label: 'population context qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/temporal_context_qualifier', - curie: 'biolink:temporal_context_qualifier', - label: 'temporal context qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/publications', - curie: 'biolink:publications', - label: 'publications', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_confidence_level', - curie: 'biolink:has_confidence_level', - label: 'has confidence level', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_evidence', - curie: 'biolink:has_evidence', - label: 'has evidence', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/has_supporting_study_result', - curie: 'biolink:has_supporting_study_result', - label: 'has supporting study result', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/supporting_data_source', - curie: 'biolink:supporting_data_source', - label: 'supporting data source', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/stoichiometry', - curie: 'biolink:stoichiometry', - label: 'stoichiometry', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/FDA_approval_status', - curie: 'biolink:FDA_approval_status', - label: 'FDA approval status', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/aggregator_knowledge_source', - curie: 'biolink:aggregator_knowledge_source', - label: 'aggregator knowledge source', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/associated_environmental_context', - curie: 'biolink:associated_environmental_context', - label: 'associated environmental context', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/association_slot', - curie: 'biolink:association_slot', - label: 'association slot', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/association_type', - curie: 'biolink:association_type', - label: 'association type', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/base_coordinate', - curie: 'biolink:base_coordinate', - label: 'base coordinate', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/catalyst_qualifier', - curie: 'biolink:catalyst_qualifier', - label: 'catalyst qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/chi_squared_statistic', - curie: 'biolink:chi_squared_statistic', - label: 'chi squared statistic', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/clinical_modifier_qualifier', - curie: 'biolink:clinical_modifier_qualifier', - label: 'clinical modifier qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/end_coordinate', - curie: 'biolink:end_coordinate', - label: 'end coordinate', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/end_interbase_coordinate', - curie: 'biolink:end_interbase_coordinate', - label: 'end interbase coordinate', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/expression_site', - curie: 'biolink:expression_site', - label: 'expression site', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/frequency_qualifier', - curie: 'biolink:frequency_qualifier', - label: 'frequency qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/interacting_molecules_category', - curie: 'biolink:interacting_molecules_category', - label: 'interacting molecules category', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/interbase_coordinate', - curie: 'biolink:interbase_coordinate', - label: 'interbase coordinate', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/knowledge_source', - curie: 'biolink:knowledge_source', - label: 'knowledge source', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/logical_interpretation', - curie: 'biolink:logical_interpretation', - label: 'logical interpretation', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/mechanism_of_action', - curie: 'biolink:mechanism_of_action', - label: 'mechanism of action', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/negated', curie: 'biolink:negated', label: 'negated', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/object', curie: 'biolink:object', label: 'object', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/onset_qualifier', - curie: 'biolink:onset_qualifier', - label: 'onset qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/original_knowledge_source', - curie: 'biolink:original_knowledge_source', - label: 'original knowledge source', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/original_object', - curie: 'biolink:original_object', - label: 'original object', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/original_predicate', - curie: 'biolink:original_predicate', - label: 'original predicate', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/original_subject', - curie: 'biolink:original_subject', - label: 'original subject', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/p_value', curie: 'biolink:p_value', label: 'p value', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/phase', curie: 'biolink:phase', label: 'phase', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/phenotypic_state', - curie: 'biolink:phenotypic_state', - label: 'phenotypic state', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/predicate', curie: 'biolink:predicate', label: 'predicate', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/primary_knowledge_source', - curie: 'biolink:primary_knowledge_source', - label: 'primary knowledge source', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/provided_by', - curie: 'biolink:provided_by', - label: 'provided by', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/qualifiers', curie: 'biolink:qualifiers', label: 'qualifiers', type: 'BioLink'}, - { - id: 'https://w3id.org/biolink/vocab/quantifier_qualifier', - curie: 'biolink:quantifier_qualifier', - label: 'quantifier qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/reaction_balanced', - curie: 'biolink:reaction_balanced', - label: 'reaction balanced', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/reaction_direction', - curie: 'biolink:reaction_direction', - label: 'reaction direction', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/reaction_side', - curie: 'biolink:reaction_side', - label: 'reaction side', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/sequence_localization_attribute', - curie: 'biolink:sequence_localization_attribute', - label: 'sequence localization attribute', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/sequence_variant_qualifier', - curie: 'biolink:sequence_variant_qualifier', - label: 'sequence variant qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/severity_qualifier', - curie: 'biolink:severity_qualifier', - label: 'severity qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/sex_qualifier', - curie: 'biolink:sex_qualifier', - label: 'sex qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/stage_qualifier', - curie: 'biolink:stage_qualifier', - label: 'stage qualifier', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/start_coordinate', - curie: 'biolink:start_coordinate', - label: 'start coordinate', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/start_interbase_coordinate', - curie: 'biolink:start_interbase_coordinate', - label: 'start interbase coordinate', - type: 'BioLink' - }, - { - id: 'https://w3id.org/biolink/vocab/genome_build', - curie: 'biolink:genome_build', - label: 'genome build', - type: 'BioLink' - }, - {id: 'https://w3id.org/biolink/vocab/strand', curie: 'biolink:strand', label: 'strand', type: 'BioLink'}, - {id: 'https://w3id.org/biolink/vocab/subject', curie: 'biolink:subject', label: 'subject', type: 'BioLink'} -]; - -export const context: any = { - APO: 'http://purl.obolibrary.org/obo/APO_', - AspGD: 'http://www.aspergillusgenome.org/cgi-bin/locus.pl?dbid=', - BFO: 'http://purl.obolibrary.org/obo/BFO_', - 'BIGG.METABOLITE': 'http://identifiers.org/bigg.metabolite/', - 'BIGG.REACTION': 'http://identifiers.org/bigg.reaction/', - BIOGRID: 'http://identifiers.org/biogrid/', - BIOSAMPLE: 'http://identifiers.org/biosample/', - BSPO: 'http://purl.obolibrary.org/obo/BSPO_', - BTO: 'http://purl.obolibrary.org/obo/BTO_', - CAID: 'http://reg.clinicalgenome.org/redmine/projects/registry/genboree_registry/by_caid?caid=', - CAS: 'http://identifiers.org/cas/', - CATH: 'http://identifiers.org/cath/', - 'CATH.SUPERFAMILY': 'http://identifiers.org/cath.superfamily/', - CDD: 'http://identifiers.org/cdd/', - CHADO: 'http://gmod.org/wiki/Chado/', - CHEBI: 'http://purl.obolibrary.org/obo/CHEBI_', - 'CHEMBL.COMPOUND': 'http://identifiers.org/chembl.compound/', - 'CHEMBL.MECHANISM': 'https://www.ebi.ac.uk/chembl/mechanism/inspect/', - 'CHEMBL.TARGET': 'http://identifiers.org/chembl.target/', - CID: 'http://pubchem.ncbi.nlm.nih.gov/compound/', - CIO: 'http://purl.obolibrary.org/obo/CIO_', - CL: 'http://purl.obolibrary.org/obo/CL_', - CLINVAR: 'http://identifiers.org/clinvar', - CLO: 'http://purl.obolibrary.org/obo/CLO_', - COAR_RESOURCE: 'http://purl.org/coar/resource_type/', - COG: 'https://www.ncbi.nlm.nih.gov/research/cog-project/', - CPT: 'https://www.ama-assn.org/practice-management/cpt/', - CTD: 'http://ctdbase.org/', - 'CTD.CHEMICAL': 'http://ctdbase.org/detail.go?type=chem&acc=', - 'CTD.DISEASE': 'http://ctdbase.org/detail.go?type=disease&db=MESH&acc=', - 'CTD.GENE': 'http://ctdbase.org/detail.go?type=gene&acc=', - ChemBank: 'http://chembank.broadinstitute.org/chemistry/viewMolecule.htm?cbid=', - ClinVarVariant: 'http://www.ncbi.nlm.nih.gov/clinvar/variation/', - DBSNP: 'http://identifiers.org/dbsnp/', - DDANAT: 'http://purl.obolibrary.org/obo/DDANAT_', - DGIdb: 'https://www.dgidb.org/interaction_types', - DOID: 'http://purl.obolibrary.org/obo/DOID_', - 'DOID-PROPERTY': 'http://purl.obolibrary.org/obo/doid#', - DRUGBANK: 'http://identifiers.org/drugbank/', - DrugCentral: 'http://drugcentral.org/drugcard/', - EC: 'http://www.enzyme-database.org/query.php?ec=', - ECO: 'http://purl.obolibrary.org/obo/ECO_', - ECTO: 'http://purl.obolibrary.org/obo/ECTO_', - 'EDAM-DATA': 'http://edamontology.org/data_', - 'EDAM-FORMAT': 'http://edamontology.org/format_', - 'EDAM-OPERATION': 'http://edamontology.org/operation_', - 'EDAM-TOPIC': 'http://edamontology.org/topic_', - EFO: 'http://www.ebi.ac.uk/efo/EFO_', - EGGNOG: 'http://identifiers.org/eggnog/', - ENSEMBL: 'http://identifiers.org/ensembl/', - ENVO: 'http://purl.obolibrary.org/obo/ENVO_', - ExO: 'http://purl.obolibrary.org/obo/ExO_', - FAO: 'http://purl.obolibrary.org/obo/FAO_', - FB: 'http://identifiers.org/fb/', - FBcv: 'http://purl.obolibrary.org/obo/FBcv_', - FMA: 'http://purl.obolibrary.org/obo/FMA_', - FOODON: 'http://purl.obolibrary.org/obo/FOODON_', - FYPO: 'http://purl.obolibrary.org/obo/FYPO_', - GAMMA: 'http://translator.renci.org/GAMMA_', - GENEPIO: 'http://purl.obolibrary.org/obo/GENEPIO_', - GENO: 'http://purl.obolibrary.org/obo/GENO_', - GO: 'http://purl.obolibrary.org/obo/GO_', - 'GOLD.META': 'http://identifiers.org/gold.meta/', - GOP: 'http://purl.obolibrary.org/obo/go#', - GOREL: 'http://purl.obolibrary.org/obo/GOREL_', - GSID: 'https://scholar.google.com/citations?user=', - GTEx: 'https://www.gtexportal.org/home/gene/', - GTOPDB: 'https://www.guidetopharmacology.org/GRAC/LigandDisplayForward?ligandId=', - HAMAP: 'http://identifiers.org/hamap/', - HANCESTRO: 'http://www.ebi.ac.uk/ancestro/ancestro_', - HCPCS: 'http://purl.bioontology.org/ontology/HCPCS/', - HGNC: 'http://identifiers.org/hgnc/', - 'HGNC.FAMILY': 'http://identifiers.org/hgnc.family/', - HMDB: 'http://identifiers.org/hmdb/', - HP: 'http://purl.obolibrary.org/obo/HP_', - HsapDv: 'http://purl.obolibrary.org/obo/HsapDv_', - IAO: 'http://purl.obolibrary.org/obo/IAO_', - ICD10: 'https://icd.codes/icd9cm/', - ICD9: 'http://translator.ncats.nih.gov/ICD9_', - IDO: 'http://purl.obolibrary.org/obo/IDO_', - INCHI: 'http://identifiers.org/inchi/', - INCHIKEY: 'http://identifiers.org/inchikey/', - INO: 'http://purl.obolibrary.org/obo/INO_', - INTACT: 'http://identifiers.org/intact/', - 'IUPHAR.FAMILY': 'http://identifiers.org/iuphar.family/', - KEGG: 'http://identifiers.org/kegg/', - 'KEGG.BRITE': 'http://www.kegg.jp/entry/', - 'KEGG.COMPOUND': 'http://identifiers.org/kegg.compound/', - 'KEGG.DGROUP': 'http://www.kegg.jp/entry/', - 'KEGG.DISEASE': 'http://identifiers.org/kegg.disease/', - 'KEGG.DRUG': 'http://identifiers.org/kegg.drug/', - 'KEGG.ENVIRON': 'http://identifiers.org/kegg.environ/', - 'KEGG.ENZYME': 'http://www.kegg.jp/entry/', - 'KEGG.GENE': 'http://www.kegg.jp/entry/', - 'KEGG.GLYCAN': 'http://identifiers.org/kegg.glycan/', - 'KEGG.MODULE': 'http://identifiers.org/kegg.module/', - 'KEGG.ORTHOLOGY': 'http://identifiers.org/kegg.orthology/', - 'KEGG.PATHWAY': 'https://www.kegg.jp/entry/', - 'KEGG.RCLASS': 'http://www.kegg.jp/entry/', - 'KEGG.REACTION': 'http://identifiers.org/kegg.reaction/', - LOINC: 'http://loinc.org/rdf/', - MAXO: 'http://purl.obolibrary.org/obo/MAXO_', - MEDDRA: 'http://identifiers.org/meddra/', - MESH: 'http://id.nlm.nih.gov/mesh/', - 'METANETX.REACTION': 'https://www.metanetx.org/equa_info/', - MGI: 'http://identifiers.org/mgi/', - MI: 'http://purl.obolibrary.org/obo/MI_', - MIR: 'http://identifiers.org/mir/', - MONDO: 'http://purl.obolibrary.org/obo/MONDO_', - MP: 'http://purl.obolibrary.org/obo/MP_', - MPATH: 'http://purl.obolibrary.org/obo/MPATH_', - MSigDB: 'https://www.gsea-msigdb.org/gsea/msigdb/', - NBO: 'http://purl.obolibrary.org/obo/NBO_', - 'NBO-PROPERTY': 'http://purl.obolibrary.org/obo/nbo#', - NCBIGene: 'http://identifiers.org/ncbigene/', - NCBITaxon: 'http://purl.obolibrary.org/obo/NCBITaxon_', - NCIT: 'http://purl.obolibrary.org/obo/NCIT_', - 'NCIT-OBO': 'http://purl.obolibrary.org/obo/ncit#', - NDC: 'http://identifiers.org/ndc/', - NDDF: 'http://purl.bioontology.org/ontology/NDDF/', - NLMID: 'https://www.ncbi.nlm.nih.gov/nlmcatalog/?term=', - OBAN: 'http://purl.org/oban/', - OBI: 'http://purl.obolibrary.org/obo/OBI_', - OBOREL: 'http://purl.obolibrary.org/obo/RO_', - OGMS: 'http://purl.obolibrary.org/obo/OGMS_', - OIO: 'http://www.geneontology.org/formats/oboInOwl#', - OMIM: 'http://purl.obolibrary.org/obo/OMIM_', - 'OMIM.PS': 'https://www.omim.org/phenotypicSeries/', - ORCID: 'https://orcid.org/', - ORPHA: 'http://www.orpha.net/ORDO/Orphanet_', - ORPHANET: 'http://identifiers.org/orphanet/', - 'PANTHER.FAMILY': 'http://www.pantherdb.org/panther/family.do?clsAccession=', - 'PANTHER.PATHWAY': 'http://identifiers.org/panther.pathway/', - PATO: 'http://purl.obolibrary.org/obo/PATO_', - PCO: 'http://purl.obolibrary.org/obo/PCO_', - PFAM: 'http://identifiers.org/pfam/', - 'PHARMGKB.PATHWAYS': 'http://identifiers.org/pharmgkb.pathways/', - PHAROS: 'http://pharos.nih.gov', - PIRSF: 'http://identifiers.org/pirsf/', - PMID: 'http://www.ncbi.nlm.nih.gov/pubmed/', - PO: 'http://purl.obolibrary.org/obo/PO_', - PR: 'http://purl.obolibrary.org/obo/PR_', - PRINTS: 'http://identifiers.org/prints/', - PRODOM: 'http://identifiers.org/prodom/', - PROSITE: 'http://identifiers.org/prosite/', - 'PUBCHEM.COMPOUND': 'http://identifiers.org/pubchem.compound/', - 'PUBCHEM.SUBSTANCE': 'http://identifiers.org/pubchem.substance/', - PW: 'http://purl.obolibrary.org/obo/PW_', - PathWhiz: 'http://smpdb.ca/pathways/#', - PomBase: 'https://www.pombase.org/gene/', - REACT: 'http://www.reactome.org/PathwayBrowser/#/', - REPODB: 'http://apps.chiragjpgroup.org/repoDB/', - RFAM: 'http://identifiers.org/rfam/', - RGD: 'http://identifiers.org/rgd/', - RHEA: 'http://identifiers.org/rhea/', - RNACENTRAL: 'http://identifiers.org/rnacentral/', - RO: 'http://purl.obolibrary.org/obo/RO_', - RXCUI: 'https://mor.nlm.nih.gov/RxNav/search?searchBy=RXCUI&searchTerm=', - RXNORM: 'http://purl.bioontology.org/ontology/RXNORM/', - ResearchID: 'https://publons.com/researcher/', - 'SEED.REACTION': 'https://modelseed.org/biochem/reactions/', - SEMMEDDB: 'https://skr3.nlm.nih.gov/SemMedDB', - SEPIO: 'http://purl.obolibrary.org/obo/SEPIO_', - SGD: 'http://identifiers.org/sgd/', - 'SIDER.DRUG': 'http://identifiers.org/sider.drug/', - SIO: 'http://semanticscience.org/resource/SIO_', - SMART: 'http://identifiers.org/smart/', - SMPDB: 'http://identifiers.org/smpdb/', - SNOMED: 'http://www.snomedbrowser.com/Codes/Details/', - SNOMEDCT: 'http://www.snomedbrowser.com/Codes/Details/', - SO: 'http://purl.obolibrary.org/obo/SO_', - STATO: 'http://purl.obolibrary.org/obo/STATO_', - STY: 'http://purl.bioontology.org/ontology/STY/', - SUPFAM: 'http://identifiers.org/supfam/', - ScopusID: 'https://www.scopus.com/authid/detail.uri?authorId=', - TAXRANK: 'http://purl.obolibrary.org/obo/TAXRANK_', - TCDB: 'http://identifiers.org/tcdb/', - TIGRFAM: 'http://identifiers.org/tigrfam/', - TO: 'http://purl.obolibrary.org/obo/TO_', - UBERGRAPH: 'http://translator.renci.org/ubergraph-axioms.ofn#', - UBERON: 'http://purl.obolibrary.org/obo/UBERON_', - UBERON_CORE: 'http://purl.obolibrary.org/obo/uberon/core#', - UBERON_NONAMESPACE: 'http://purl.obolibrary.org/obo/core#', - UMLS: 'http://identifiers.org/umls/', - UMLSSG: 'https://lhncbc.nlm.nih.gov/semanticnetwork/download/sg_archive/SemGroups-v04.txt', - UNII: 'http://identifiers.org/unii/', - 'UNIPROT.ISOFORM': 'http://identifiers.org/uniprot.isoform/', - 'UO-PROPERTY': 'http://purl.obolibrary.org/obo/uo#', - UPHENO: 'http://purl.obolibrary.org/obo/UPHENO_', - UniProtKB: 'http://identifiers.org/uniprot/', - VANDF: 'https://www.nlm.nih.gov/research/umls/sourcereleasedocs/current/VANDF/', - VMC: 'https://github.com/ga4gh/vr-spec/', - WB: 'http://identifiers.org/wb/', - WBPhenotype: 'http://purl.obolibrary.org/obo/WBPhenotype_', - WBVocab: 'http://bio2rdf.org/wormbase_vocabulary', - WIKIDATA: 'https://www.wikidata.org/wiki/', - WIKIDATA_PROPERTY: 'https://www.wikidata.org/wiki/Property:', - WIKIPATHWAYS: 'http://identifiers.org/wikipathways/', - WormBase: 'https://www.wormbase.org/get?name=', - XCO: 'http://purl.obolibrary.org/obo/XCO_', - XPO: 'http://purl.obolibrary.org/obo/XPO_', - Xenbase: 'http://www.xenbase.org/gene/showgene.do?method=display&geneId=', - ZFIN: 'http://identifiers.org/zfin/', - ZP: 'http://purl.obolibrary.org/obo/ZP_', - alliancegenome: 'https://www.alliancegenome.org/', - apollo: 'https://github.com/GMOD/Apollo', - biolink: 'https://w3id.org/biolink/vocab/', - bioschemas: 'https://bioschemas.org/', - dcat: 'http://www.w3.org/ns/dcat#', - dcid: 'https://datacommons.org/browser/', - dct: 'http://purl.org/dc/terms/', - dctypes: 'http://purl.org/dc/dcmitype/', - dictyBase: 'http://dictybase.org/gene/', - doi: 'https://doi.org/', - fabio: 'http://purl.org/spar/fabio/', - faldo: 'http://biohackathon.org/resource/faldo#', - foaf: 'http://xmlns.com/foaf/0.1/', - 'foodb.compound': 'http://foodb.ca/compounds/', - gff3: 'https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md#', - gpi: 'https://github.com/geneontology/go-annotation/blob/master/specs/gpad-gpi-2-0.md#', - gtpo: 'https://rdf.guidetopharmacology.org/ns/gtpo#', - interpro: 'https://www.ebi.ac.uk/interpro/entry/', - isbn: 'https://www.isbn-international.org/identifier/', - isni: 'https://isni.org/isni/', - issn: 'https://portal.issn.org/resource/ISSN/', - linkml: 'https://w3id.org/linkml/', - medgen: 'https://www.ncbi.nlm.nih.gov/medgen/', - 'metacyc.reaction': 'https://identifiers.org/metacyc.reaction:', - mirbase: 'http://identifiers.org/mirbase', - oboInOwl: 'http://www.geneontology.org/formats/oboInOwl#', - oboformat: 'http://www.geneontology.org/formats/oboInOwl#', - os: 'https://github.com/cmungall/owlstar/blob/master/owlstar.ttl', - owl: 'http://www.w3.org/2002/07/owl#', - pav: 'http://purl.org/pav/', - prov: 'http://www.w3.org/ns/prov#', - qud: 'http://qudt.org/1.1/schema/qudt#', - rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - rdfs: 'http://www.w3.org/2000/01/rdf-schema#', - schema: 'http://schema.org/', - skos: 'http://www.w3.org/2004/02/skos/core#', - wgs: 'http://www.w3.org/2003/01/geo/wgs84_pos', - xsd: 'http://www.w3.org/2001/XMLSchema#' -}; - -export const sentenceToAnnotate = [ - { - text: 'Iloperidone tablets are indicated for the treatment of schizophrenia in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=eeb0fcfd-e4e8-4fb1-9635-901dc9446235' - }, - { - text: 'Clozapine is indicated for the treatment of severely ill patients with schizophrenia who fail to respond adequately to standard antipsychotic treatment', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=25c0c6d5-f7b0-48e4-e054-00144ff8d46c' - }, - { - text: 'Clonidine hydrochloride injection is indicated in combination with opiates for the treatment of severe pain in cancer patients that is not adequately relieved by opioid analgesics alone', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=d2b11e61-b2ef-4d20-8973-a4afc6b951ae' - }, - { - text: 'For the management of acute pain in adults', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=27d813ea-7798-09cb-734b-b970d7248f1f' - }, - { - text: "ARICEPT is indicated for the treatment of dementia of the Alzheimer's type.", - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2b1b7b5f-2f20-418c-b1ac-794c2ef1ce5e' - }, - { - text: 'Buspirone hydrochloride tablets are indicated for the management of anxiety disorders or the short-term relief of the symptoms of anxiety. Anxiety or tension associated with the stress of everyday life usually does not require treatment with an anxiolytic.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=33999f17-f689-40a1-955a-fb19c0590e0e' - }, - { - text: 'Lithium Carbonate Extended-Release Tablets USP are indicated in the treatment of manic episodes of Bipolar Disorder.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ebda1da0-38a2-49a0-8478-5d1d991a63bd' - }, - { - text: "Memantine hydrochloride oral solution is indicated for the treatment of moderate to severe dementia of the Alzheimer's type.", - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=4076d3ef-d0a9-96c5-1a15-812c1e42929c' - }, - { - text: 'Clonazepam is useful alone or as an adjunct in the treatment of the Lennox-Gastaut syndrome (petit mal variant), akinetic and myoclonic seizures.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=acbce0e8-5098-4785-943b-8bdb5ff17fab' - }, - { - text: 'Clonazepam is indicated for the treatment of panic disorder, with or without agoraphobia, as defined in DSM-IV', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=acbce0e8-5098-4785-943b-8bdb5ff17fab' - }, - { - text: 'Venlafaxine tablets, USP are indicated for the treatment of major depressive disorder.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b23637e5-d37f-41b5-ba76-fc053e903bc2' - }, - { - text: 'AIMOVIG is indicated for the preventive treatment of migraine in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b998ed05-94b0-47fd-b28f-cddd1e128fd8' - }, - { - text: 'AMRIX (cyclobenzaprine hydrochloride extended-release capsules) is indicated as an adjunct to rest and physical therapy for relief of muscle spasm associated with acute, painful musculoskeletal conditions.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=3902123b-1365-ac3c-0934-afff9eeeb1bd' - }, - { - text: 'Amphetamine sulfate tablets, USP 5 mg and 10 mg are indicated for: Narcolepsy', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=53d40847-e0d3-48ec-81a7-ec5478553565' - }, - { - text: 'Amphetamine sulfate tablets, USP 5 mg and 10 mg are indicated for: Attention Deficit Disorder with Hyperactivity as an integral part of a total treatment program which typically includes other remedial measures (psychological, educational, social) for a stabilizing effect in children with behavioral syndrome characterized by the following group of developmentally inappropriate symptoms: moderate to severe distractibility, short attention span, hyperactivity, emotional lability, and impulsivity. The diagnosis of the syndrome should not be made with finality when these symptoms are only of comparatively recent origin. Nonlocalizing (soft) neurological signs, learning disability, and abnormal EEG may or may not be present, and a diagnosis of central nervous system dysfunction may or not be warranted.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=53d40847-e0d3-48ec-81a7-ec5478553565' - }, - { - text: 'Clonazepam is useful alone or as an adjunct in the treatment of the Lennox-Gastaut syndrome (petit mal variant), akinetic and myoclonic seizures.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=acbce0e8-5098-4785-943b-8bdb5ff17fab' - }, - { - text: 'Methylphenidate Hydrochloride is indicated as an integral part of a total treatment program which typically includes other remedial measures (psychological, educational, social) for a stabilizing effect in children with a behavioral syndrome characterized by the following group of developmentally inappropriate symptoms: moderate-to-severe distractibility, short attention span, hyperactivity, emotional lability, and impulsivity', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2cf1b26b-199d-4c7f-ab64-4805a9def2cc' - }, - { - text: 'Indications and Usage: Attention Deficit Disorders, Narcolepsy', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2cf1b26b-199d-4c7f-ab64-4805a9def2cc' - }, - { - text: 'Lamotrigine tablets are indicated as adjunctive therapy for the following seizure types in patients aged 2 years and older', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0b0f0209-edbd-46f3-9bed-762cbea0d737' - }, - { - text: 'Lamotrigine tablets are indicated for conversion to monotherapy in adults (aged 16 years and older) with partial-onset seizures who are receiving treatment with carbamazepine, phenytoin, phenobarbital, primidone, or valproate as the single antiepileptic drug (AED).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0b0f0209-edbd-46f3-9bed-762cbea0d737' - }, - { - text: 'Lamotrigine tablets are indicated for the maintenance treatment of bipolar I disorder to delay the time to occurrence of mood episodes (depression, mania, hypomania, mixed episodes) in patients treated for acute mood episodes with standard therapy', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0b0f0209-edbd-46f3-9bed-762cbea0d737' - }, - { - text: 'Topiramate tablets and topiramate capsules are indicated as initial monotherapy for the treatment of partial-onset or primary generalized tonic-clonic seizures in patients 2 years of age and older', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6f9d59e3-d10d-48f3-af01-83ba3e1e3a2b' - }, - { - text: 'Gabapentin capsules, USP are indicated as adjunctive therapy in the treatment of partial seizures with and without secondary generalization in patients over 12 years of age with epilepsy. Gabapentin capsules, USP are also indicated as adjunctive therapy in the treatment of partial seizures in pediatric patients age 3 to 12 years.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0936a88f-b569-49c4-951b-14e8f6273b53' - }, - { - text: 'Topiramate tablets and topiramate capsules are indicated as adjunctive therapy for for the treatment of partial-onset seizures, primary generalized tonic-clonic seizures, and seizures associated with Lennox-Gastaut syndrome in patients 2 years of age and older', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6f9d59e3-d10d-48f3-af01-83ba3e1e3a2b' - }, - { - text: 'Topiramate tablets and topiramate capsules are indicated for the preventive treatment of migraine in patients 12 years of age and older', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6f9d59e3-d10d-48f3-af01-83ba3e1e3a2b' - }, - { - text: 'Quetiapine tablets are indicated for the treatment of schizophrenia', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=904f80af-44b6-d964-1680-ac9e6b61327b' - }, - { - text: 'Quetiapine tablets are indicated for the acute treatment of manic episodes associated with bipolar I disorder, both as monotherapy and as an adjunct to lithium or divalproex', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=904f80af-44b6-d964-1680-ac9e6b61327b' - }, - { - text: 'Quetiapine tablets are indicated as monotherapy for the acute treatment of depressive episodes associated with bipolar disorder.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=904f80af-44b6-d964-1680-ac9e6b61327b' - }, - { - text: 'Alprazolam extended-release tablets are indicated for the treatment of panic disorder, with or without agoraphobia.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=79619e0f-1600-40ea-e053-2a91aa0a2700' - }, - { - text: 'Tizanidine hydrochloride capsules are central alpha-2-adrenergic agonist indicated for the management of spasticity', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=e19636a4-3c5e-4b75-b394-003098f74d48' - }, - { - text: 'Uses: temporarily reduces pains and aches due to headache, toothache, backache, menstrual cramps, the common cold, muscular aches, minor pains of arthritis, temporarily reduces fever', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=5c65b691-b795-44a5-abb7-931cd772f1a1' - }, - { - text: 'Levetiracetam in Sodium Chloride Injection is indicated as adjunctive therapy in the treatment of partial onset seizures in adults with epilepsy.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0a9234b7-46b1-8e6c-a992-90f86cfb6e00' - }, - { - text: "Tolcapone tablets, USP is indicated as an adjunct to levodopa and carbidopa for the treatment of the signs and symptoms of idiopathic Parkinson's disease", - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=d94891be-2fef-4e39-8e35-ab7afe93e78e' - }, - { - text: 'Levetiracetam in Sodium Chloride Injection is indicated as adjunctive therapy in the treatment of myoclonic seizures in adults with juvenile myoclonic epilepsy.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0a9234b7-46b1-8e6c-a992-90f86cfb6e00' - }, - { - text: 'Levetiracetam in Sodium Chloride Injection is indicated as adjunctive therapy in the treatment of primary generalized tonic-clonic seizures in adults with idiopathic generalized epilepsy.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0a9234b7-46b1-8e6c-a992-90f86cfb6e00' - }, - { - text: 'Divalproex sodium delayed-release capsules are indicated as monotherapy and adjunctive therapy in the treatment of adult patients and pediatric patients down to the age of 10 years with complex partial seizures that occur either in isolation or in association with other types of seizures.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f911748c-fb3a-fe1a-ab2a-4b40455e05ef' - }, - { - text: 'Uses - temporarily relieves minor aches and pains due to: minor pain of arthritis, backache, headache, muscular aches, menstrual cramps, toothache, common cold, temporarily reduces fever', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=bc5ddcf2-640c-4683-a60f-ca1c8b418873' - }, - { - text: 'Baclofen is useful for the alleviation of signs and symptoms of spasticity resulting from multiple sclerosis, particularly for the relief of flexor spasms and concomitant pain, clonus, and muscular rigidity.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=346af8fe-3816-49de-bfd3-5a7425e728f9' - }, - { - text: 'Diclofenac potassium tablets are indicated:For relief of mild to moderate pain', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=77b60a0c-e49a-4ad4-abb1-b662c24ab782' - }, - { - text: 'Baclofen may also be of some value in patients with spinal cord injuries and other spinal cord diseases.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=346af8fe-3816-49de-bfd3-5a7425e728f9' - }, - { - text: 'Mirtazapine tablets, USP are indicated for the treatment of major depressive disorder.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0039f505-7cd0-4d79-b5dd-bf2d172571a0' - }, - { - text: 'Hydrocodone Bitartrate Extended-Release Capsules are indicated for the management of pain severe enough to require daily, around-the-clock, long-term opioid treatment and for which alternative treatment options are inadequate.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=a7b8ea07-e926-f0a5-c20d-92f23ed350d0' - }, - { - text: 'Almotriptan tablets (almotriptan malate) are indicated for the acute treatment of migraine attacks in patients with a history of migraine with or without aura', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=35617039-9f33-401b-bac3-8f85c65fa2c7' - }, - { - text: 'Carisoprodol Tablets are indicated for the relief of discomfort associated with acute, painful musculoskeletal conditions in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ab22f1be-16c8-45b6-adaf-09e08bf7a545' - }, - { - text: 'Ropinirole tablets are indicated for the treatment of Parkinson’s disease', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f5ce07b9-ad0d-4b72-9daf-8662775af093' - }, - { - text: 'Ropinirole tablets are indicated for the treatment of moderate-to-severe primary Restless Legs Syndrome (RLS).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f5ce07b9-ad0d-4b72-9daf-8662775af093' - }, - { - text: 'Methocarbamol tablets, USP are indicated as an adjunct to rest, physical therapy, and other measures for the relief of discomfort associated with acute, painful musculoskeletal conditions.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=42c0a177-7d62-4bcf-9fce-7dd484cda4d5' - }, - { - text: 'Oxcarbazepine oral suspension is indicated for use as monotherapy or adjunctive therapy in the treatment of partial-onset seizures in adults and as monotherapy in the treatment of partial-onset seizures in pediatric patients aged 4 years and above, and as adjunctive therapy in pediatric patients aged 2 years and above with partial-onset seizures.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2515391e-3a88-4226-92e5-f641c8409fe5' - }, - { - text: 'Pramipexole dihydrochloride tablets are indicated for the treatment of Parkinson’s disease.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=4fe7106d-4bf6-4794-87cb-8df616994c41' - }, - { - text: 'Pramipexole dihydrochloride tablets are indicated for the treatment of moderate-to-severe primary Restless Legs Syndrome (RLS).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=4fe7106d-4bf6-4794-87cb-8df616994c41' - }, - { - text: 'Atomoxetine capsules are indicated for the treatment of Attention-Deficit/Hyperactivity Disorder (ADHD).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6f6bea0c-297b-43ff-8960-ecc11243e06e' - }, - { - text: 'Topiramate tablets and topiramate capsules are indicated as adjunctive therapy for for the treatment of partial-onset seizures, primary generalized tonic-clonic seizures, and seizures associated with Lennox-Gastaut syndrome in patients 2 years of age and older', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6f9d59e3-d10d-48f3-af01-83ba3e1e3a2b' - }, - { - text: 'PRIALT (ziconotide) solution, intrathecal infusion is indicated for the management of severe chronic pain in adult patients for whom intrathecal therapy is warranted, and who are intolerant of or refractory to other treatment, such as systemic analgesics, adjunctive therapies, or intrathecal morphine', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b025d8ed-937d-4597-9ad1-0b2f6e0ee5b1' - }, - { - text: 'Vyvanse is indicated for the treatment of Attention Deficit Hyperactivity Disorder (ADHD).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=a310fc51-2743-4755-8398-fed5402283f6' - }, - { - text: 'As an antiaggregant in antiplatelet therapy or for temporary relief of minor aches and pains.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=80ce8064-0e27-4587-b70b-2ea3c9aa2786' - }, - { - text: 'Trihexyphenidyl is indicated as an adjunct in the treatment of all forms of parkinsonism (postencephalitic, arteriosclerotic, and idiopathic). It is often useful as adjuvant therapy when treating these forms of parkinsonism with levodopa.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=d6f08000-e973-4bab-810c-b69f6c8ee4f3' - }, - { - text: 'Additionally, it is indicated for the control of extrapyramidal disorders caused by central nervous system drugs such as the dibenzoxazepines, phenothiazines, thioxanthenes, and butyrophenones.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=d6f08000-e973-4bab-810c-b69f6c8ee4f3' - }, - { - text: 'Dextroamphetamine sulfate tablets are indicated in: Narcolepsy and Attention Deficit Disorder with Hyperactivity: As an integral part of a total treatment program that typically includes other remedial measures (psychological, educational, social) for a stabilizing effect in pediatric patients (ages 3 years to 16 years)', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=bed3c03f4-2829-423f-a595-dc09c9cc0e40' - }, - { - text: 'Dextroamphetamine sulfate tablets are indicated in: Narcolepsy and Attention Deficit Disorder with Hyperactivity: As an integral part of a total treatment program that typically includes other remedial measures (psychological, educational, social) for a stabilizing effect in pediatric patients (ages 3 years to 16 years)', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=bed3c03f4-2829-423f-a595-dc09c9cc0e40' - }, - { - text: 'Morphine sulfate is indicated for the relief of severe pain', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=e360d6b6-d9ef-487d-bf14-fcbbee8beb29' - }, - { - text: 'Pyridostigmine Bromide Oral Solution, USP is useful in the treatment of myasthenia gravis.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ef78ff05-8e0f-463a-88cd-ca9a01aed76a' - }, - { - text: 'Buprenorphine Sublingual Tablets are indicated for the treatment of opioid dependence and are preferred for induction', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=1bf8b35a-b769-465c-a2f8-099868dfcd2f' - }, - { - text: 'Naltrexone hydrochloride tablets USP 50 mg is indicated in the treatment of alcohol dependence', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=49aa3d6d-2270-4615-aafa-b440859ab870' - }, - { - text: "Bromocriptine mesylate tablets are indicated in the treatment of the signs and symptoms of idiopathic or postencephalitic Parkinson's disease. As adjunctive treatment to levodopa (alone or with a peripheral decarboxylase inhibitor), bromocriptine mesylate therapy may provide additional therapeutic benefits in those patients who are currently maintained on optimal dosages of levodopa, those who are beginning to deteriorate (develop tolerance) to levodopa therapy, and those who are experiencing end of dose failure on levodopa therapy. ", - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=93a0696b-b261-4262-9e06-f3180b419f8f' - }, - { - text: 'RADICAVA is indicated for the treatment of amyotrophic lateral sclerosis (ALS).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=0ce2c1c4-2a40-485c-b7cb-96a9b85d9d11' - }, - { - text: "Tetrabenazine tablets are indicated for the treatment of chorea associated with Huntington's disease.", - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=471ac1d8-e3ad-7729-87c5-c26ae92c32eb' - }, - { - text: 'Riluzole is indicated for the treatment of amyotrophic lateral sclerosis(ALS).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=dd432c13-389e-46b3-8891-0cf1a58800ff' - }, - { - text: 'RUZURGI is indicated for the treatment of Lambert-Eaton myasthenic syndrome (LEMS) in patients 6 to less than 17 years of age.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2731310a-c060-4d3e-ba41-763d791f63a9' - }, - { - text: 'USES: For the temporary relief of discomfort and pain associated with - minor burns and skin irritations, minor cuts and scrapes, itching', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=60cafbaf-8ec6-46a5-e053-2a91aa0af11f' - }, - { - text: 'Cevimeline hydrochloride capsules are indicated for the treatment of symptoms of dry mouth in patients with Sjögren’s Syndrome.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=773a19e8-4c3e-4414-99a6-aea98c9790ee' - }, - { - text: 'temporarily relieves minor aches and pains due to: the common cold headache backache minor pain of arthritis toothache muscular aches premenstrual and menstrual cramps temporarily reduces fever', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=9f7cca9d-4230-49d7-b805-a1fbc73e31c9' - }, - { - text: 'temporarily relieves minor aches and pains due to: the common cold headache backache minor pain of arthritis toothache muscular aches premenstrual and menstrual cramps temporarily reduces fever', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=9f7cca9d-4230-49d7-b805-a1fbc73e31c9' - }, - { - text: 'Clonazepam is useful alone or as an adjunct in the treatment of the Lennox-Gastaut syndrome (petit mal variant), akinetic and myoclonic seizures.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=acbce0e8-5098-4785-943b-8bdb5ff17fab' - }, - { - text: 'Clonazepam is useful alone or as an adjunct in the treatment of the Lennox-Gastaut syndrome (petit mal variant), akinetic and myoclonic seizures.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=acbce0e8-5098-4785-943b-8bdb5ff17fab' - }, - { - text: 'Temazepam is indicated for the short-term treatment of insomnia (generally 7 to 10 days).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=a4370eb4-b00d-4247-af8d-980e59fbbec6' - }, - { - text: 'Diazepam is a useful adjunct for the relief of skeletal muscle spasm due to reflex spasm to local pathology (such as inflammation of the muscles or joints, or secondary to trauma), spasticity caused by upper motor neuron disorders (such as cerebral palsy and paraplegia); athetosis; stiff man syndrome; and tetanus.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Diazepam is a useful adjunct for the relief of skeletal muscle spasm due to reflex spasm to local pathology (such as inflammation of the muscles or joints, or secondary to trauma), spasticity caused by upper motor neuron disorders (such as cerebral palsy and paraplegia); athetosis; stiff man syndrome; and tetanus.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Diazepam is a useful adjunct for the relief of skeletal muscle spasm due to reflex spasm to local pathology (such as inflammation of the muscles or joints, or secondary to trauma), spasticity caused by upper motor neuron disorders (such as cerebral palsy and paraplegia); athetosis; stiff man syndrome; and tetanus.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Diazepam is a useful adjunct for the relief of skeletal muscle spasm due to reflex spasm to local pathology (such as inflammation of the muscles or joints, or secondary to trauma), spasticity caused by upper motor neuron disorders (such as cerebral palsy and paraplegia); athetosis; stiff man syndrome; and tetanus.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Diazepam is a useful adjunct for the relief of skeletal muscle spasm due to reflex spasm to local pathology (such as inflammation of the muscles or joints, or secondary to trauma), spasticity caused by upper motor neuron disorders (such as cerebral palsy and paraplegia); athetosis; stiff man syndrome; and tetanus.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Diazepam is a useful adjunct for the relief of skeletal muscle spasm due to reflex spasm to local pathology (such as inflammation of the muscles or joints, or secondary to trauma), spasticity caused by upper motor neuron disorders (such as cerebral palsy and paraplegia); athetosis; stiff man syndrome; and tetanus.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Lorazepam injection is indicated for the treatment of status epilepticus.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ae274b1f-27c3-483b-99f1-9a9249dc2459' - }, - { - text: 'Lorazepam injection is indicated in adult patients for preanesthetic medication, producing sedation (sleepiness or drowsiness), relief of anxiety, and a decreased ability to recall events related to the day of surgery. It is most useful in those patients who are anxious about their surgical procedure and who would prefer to have diminished recall of the events of the day of surgery', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ae274b1f-27c3-483b-99f1-9a9249dc2459' - }, - { - text: 'Amantadine hydrochloride capsules are also indicated in the treatment of parkinsonism and drug-induced extrapyramidal reactions.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=491aea85-5a55-4a7c-b1cf-a123fea4377d' - }, - { - text: 'ABSTRAL is indicated for the management of breakthrough pain in cancer patients 18 years of age and older who are already receiving, and who are tolerant to, around-the-clock opioid therapy for their underlying persistent cancer pain.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=e60f00e9-2cf4-4c20-b570-1c2ea426c8c7' - }, - { - text: 'Diazepam is indicated for the management of anxiety disorders for the short-term relief of the symptoms of anxiety. Anxiety or tension associated with the stress of everyday life usually does not require treatment with an anxiolytic.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Diazepam injection is a useful adjunct in status epilepticus and severe recurrent convulsive seizures.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Iloperidone tablets are indicated for the treatment of schizophrenia in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=eeb0fcfd-e4e8-4fb1-9635-901dc9446235' - }, - { - text: 'Aripiprazole oral solution is indicated for the treatment of: Schizophrenia', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7f272100-e02f-4a16-bb39-a2bf844db4f9' - }, - { - text: 'Aripiprazole oral solution is indicated for the treatment of: acute Treatment of Manic and Mixed Episodes associated with Bipolar I Disorder ', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7f272100-e02f-4a16-bb39-a2bf844db4f9' - }, - { - text: 'Aripiprazole oral solution is indicated for the treatment of: Adjunctive Treatment of Major Depressive Disorder', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7f272100-e02f-4a16-bb39-a2bf844db4f9' - }, - { - text: 'Aripiprazole oral solution is indicated for the treatment of: Irritability Associated with Autistic Disorder', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7f272100-e02f-4a16-bb39-a2bf844db4f9' - }, - { - text: 'Felbamate oral suspension is recommended for use only in those patients who respond inadequately to alternative treatments and whose epilepsy is so severe that a substantial risk of aplastic anemia and/or liver failure is deemed acceptable in light of the benefits conferred by its use', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2e325d79-d0a4-4af7-b09b-96ee5a5b2a37' - }, - { - text: 'Vigabatrin for oral solution is indicated as adjunctive therapy for adults and pediatric patients 2 years of age and older with refractory complex partial seizures who have inadequately responded to several alternative treatments and for whom the potential benefits outweigh the risk of vision loss', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=5b8fb137-848b-45fd-9107-a6db5a675360' - }, - { - text: 'Selegiline capsules, USP are indicated as an adjunct in the management of Parkinsonian patients being treated with levodopa/carbidopa who exhibit deterioration in the quality of their response to this therapy.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=1924db3d-6a16-4496-cfd0-6903be146925' - }, - { - text: 'Vigabatrin for oral solution is indicated as monotherapy for pediatric patients with infantile spasms 1 month to 2 years of age for whom the potential benefits outweigh the potential risk of vision loss', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=5b8fb137-848b-45fd-9107-a6db5a675360' - }, - { - text: 'Extended phenytoin sodium capsules are indicated for the treatment of tonic-clonic (grand mal) and psychomotor (temporal lobe) seizures and prevention and treatment of seizures occurring during or following neurosurgery', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7e467c02-49a0-4b62-b537-430fdfa4f10e' - }, - { - text: 'Fosphenytoin sodium injection is indicated for the treatment of generalized tonic-clonic status epilepticus and prevention and treatment of seizures occurring during neurosurgery.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b60c9c82-e5c7-4e05-98c7-5bbba4af04b2' - }, - { - text: 'Risperidone tablets are indicated for the acute and maintenance treatment of schizophrenia', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=c0c3eeb6-8a75-0b20-2008-396e63cddcdb' - }, - { - text: 'Due to Janssen Pharmaceuticals Corporation’s marketing exclusivity rights, this drug product is not labeled for use in pediatric patients with bipolar mania. Pediatric use information for the treatment of pediatric patients with bipolar mania, 10 to 17 years of age, is approved for Janssen Pharmaceuticals Corporation’s risperidone drug products.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=c0c3eeb6-8a75-0b20-2008-396e63cddcdb' - }, - { - text: 'Risperidone tablets are indicated for the short-term treatment of acute manic or mixed episodes associated with Bipolar I Disorder in Adults', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=c0c3eeb6-8a75-0b20-2008-396e63cddcdb' - }, - { - text: 'Combination Therapy - Adults: The combination of risperidone with lithium or valproate is indicated for the short-term treatment of acute manic or mixed episodes associated with Bipolar I Disorder', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=c0c3eeb6-8a75-0b20-2008-396e63cddcdb' - }, - { - text: 'Risperidone tablets are indicated for the treatment of irritability associated with autistic disorder in children and adolescents aged 5-16 years, including symptoms of aggression towards others, deliberate self-injuriousness, temper tantrums, and quickly changing moods', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=c0c3eeb6-8a75-0b20-2008-396e63cddcdb' - }, - { - text: 'ONGENTYS is indicated as adjunctive treatment to levodopa/carbidopa in patients with Parkinson’s disease (PD) experiencing “off” episodes', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=278a60c4-2353-4657-b486-f392b93181b7' - }, - { - text: 'Entacapone tablets are indicated as an adjunct to levodopa and carbidopa to treat end-of-dose “wearing-off” in patients with Parkinson’s disease', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=e9e94e9f-cd7a-45f5-9aeb-9c28ed804d8c' - }, - { - text: 'For the relief of symptoms of depression. Endogenous depression is more likely to be alleviated than other depressive states', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=92ca69d4-cdba-4789-91a9-922664d52498' - }, - { - text: 'Sertraline Tablets, USP are indicated for the treatment of major depressive disorder in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f9641190-9151-4f7e-89ff-1e7a818c30ee' - }, - { - text: 'Sertraline tablets are indicated for the treatment of obsessions and compulsions in patients with obsessive-compulsive disorder (OCD), as defined in the DSM-III-R; i.e., the obsessions or compulsions cause marked distress, are time-consuming, or significantly interfere with social or occupational functioning.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f9641190-9151-4f7e-89ff-1e7a818c30ee' - }, - { - text: 'Sertraline tablets are indicated for the treatment of panic disorder in adults, with or without agoraphobia, as defined in DSM-IV.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f9641190-9151-4f7e-89ff-1e7a818c30ee' - }, - { - text: 'Sertraline is indicated for the treatment of posttraumatic stress disorder in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f9641190-9151-4f7e-89ff-1e7a818c30ee' - }, - { - text: 'Sertraline tablets are indicated for the treatment of social anxiety disorder, also known as social phobia in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f9641190-9151-4f7e-89ff-1e7a818c30ee' - }, - { - text: 'Fluoxetine is indicated for the acute and maintenance treatment of Major Depressive Disorder in adult patients and in pediatric patients aged 8 to18 years', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=59de2889-c3d3-4ebf-8826-13f30a3fa439' - }, - { - text: 'Fluoxetine is indicated for the acute and maintenance treatment of obsessions and compulsions in adult patients and in pediatric patients aged 7 to 17 years with Obsessive Compulsive Disorder (OCD)', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=59de2889-c3d3-4ebf-8826-13f30a3fa439' - }, - { - text: 'Fluoxetine is indicated for the acute and maintenance treatment of binge-eating and vomiting behaviors in adult patients with moderate to severe Bulimia Nervosa', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=59de2889-c3d3-4ebf-8826-13f30a3fa439' - }, - { - text: 'Fluoxetine is indicated for the acute and maintenance treatment of binge-eating and vomiting behaviors in adult patients with moderate to severe Bulimia Nervosa ', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=59de2889-c3d3-4ebf-8826-13f30a3fa439' - }, - { - text: 'Fluoxetine is indicated for the acute treatment of Panic Disorder, with or without agoraphobia, in adult patients', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=59de2889-c3d3-4ebf-8826-13f30a3fa439' - }, - { - text: 'Xyrem is indicated for the treatment of cataplexy or excessive daytime sleepiness (EDS) in patients 7 years of age and older with narcolepsy.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=926eb076-a4a8-45e4-91ef-411f0aa4f3ca' - }, - { - text: 'Fluoxetine and olanzapine in combination is indicated for the acute treatment of depressive episodes associated with Bipolar I Disorder in adult patients.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=59de2889-c3d3-4ebf-8826-13f30a3fa439' - }, - { - text: 'Orphenadrine citrate is indicated as an adjunct to rest, physical therapy, and other measures for the relief of discomfort associated with acute, painful musculo-skeletal conditions.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=aec8ad3a-f717-4e74-b7b9-19debdaad79a' - }, - { - text: 'Ramelteon tablets are indicated for the treatment of insomnia characterized by difficulty with sleep onset.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=a89dae05-6c39-4072-b8ee-c4c35b46f7d4' - }, - { - text: 'Frovatriptan succinate tablets are indicated for the acute treatment of migraine with or without aura in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=94b996dc-ddc4-41ce-9a9f-3d91cb187473' - }, - { - text: 'Sumatriptan tablets are indicated for the acute treatment of migraine with or without aura in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b2503fff-c978-4efa-b1b4-d7740b6b26f2' - }, - { - text: 'Marplan is indicated for the treatment of depression. Because of its potentially serious side effects, Marplan is not an antidepressant of first choice in the treatment of newly diagnosed depressed patient', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ac387aa0-3f04-4865-a913-db6ed6f4fdc5' - }, - { - text: 'Pimozide Tablets, USP is indicated for the suppression of motor and phonic tics in patients with Tourette’s Disorder who have failed to respond satisfactorily to standard treatment.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=70b079e2-a1f7-4a93-8685-d60a4d7c1280' - }, - { - text: 'Thiothixene capsules are effective in the management of schizophrenia.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=13d90931-e9d8-25f3-a045-608d0404cd7a' - }, - { - text: 'Treatment of adult and adolescent patients (13 to 17 years) with schizophrenia', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=afad3051-9df2-4c54-9684-e8262a133af8' - }, - { - text: 'Monotherapy treatment of adult and pediatric patients (10 to 17 years) with major depressive episode associated with bipolar I disorder (bipolar depression)', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=afad3051-9df2-4c54-9684-e8262a133af8' - }, - { - text: 'Clozapine is indicated for reducing the risk of recurrent suicidal behavior in patients with schizophrenia or schizoaffective disorder who are judged to be at chronic risk for re-experiencing suicidal behavior, based on history and recent clinical state', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=25c0c6d5-f7b0-48e4-e054-00144ff8d46c' - }, - { - text: 'Adjunctive treatment with lithium or valproate in adult patients with major depressive episode associated with bipolar I disorder (bipolar depression)', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=afad3051-9df2-4c54-9684-e8262a133af8' - }, - { - text: 'Duloxetine delayed-release capsules are indicated for the treatment of: Major Depressive Disorder, Generalized Anxiety Disorder, Diabetic Peripheral Neuropathy, Fibromyalgia, Chronic Muscoskeletal Pain', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ea2dc1a6-22d5-4295-9d39-9bf015dc5a89' - }, - { - text: 'Duloxetine delayed-release capsules are indicated for the treatment of: Major Depressive Disorder, Generalized Anxiety Disorder, Diabetic Peripheral Neuropathy, Fibromyalgia, Chronic Muscoskeletal Pain', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ea2dc1a6-22d5-4295-9d39-9bf015dc5a89' - }, - { - text: 'Duloxetine delayed-release capsules are indicated for the treatment of: Major Depressive Disorder, Generalized Anxiety Disorder, Diabetic Peripheral Neuropathy, Fibromyalgia, Chronic Muscoskeletal Pain', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ea2dc1a6-22d5-4295-9d39-9bf015dc5a89' - }, - { - text: 'Duloxetine delayed-release capsules are indicated for the treatment of: Major Depressive Disorder, Generalized Anxiety Disorder, Diabetic Peripheral Neuropathy, Fibromyalgia, Chronic Muscoskeletal Pain', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ea2dc1a6-22d5-4295-9d39-9bf015dc5a89' - }, - { - text: 'Protriptyline hydrochloride is indicated for the treatment of symptoms of mental depression in patients who are under close medical supervision.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=700abc58-9362-4ef5-9d7a-dd3c4d364d0a' - }, - { - text: 'Bupropion hydrochloride extended-release tablets (XL) are indicated for the treatment of major depressive disorder (MDD), as defined by the Diagnostic and Statistical Manual (DSM).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f32a4532-7dfd-4aa5-bb48-afbbd2eefb7c' - }, - { - text: 'Bupropion hydrochloride extended-release tablets (XL) are indicated for the prevention of seasonal major depressive episodes in patients with a diagnosis of seasonal affective disorder (SAD).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f32a4532-7dfd-4aa5-bb48-afbbd2eefb7c' - }, - { - text: 'Endogenous depression is more likely to be alleviated than are other depressive states.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=94e984da-3b08-406f-8c10-e78844fca1ff' - }, - { - text: 'For the relief of symptoms of depression.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=94e984da-3b08-406f-8c10-e78844fca1ff' - }, - { - text: 'Endogenous depression is more likely to be alleviated than other depressive states.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=4f31df66-7dc2-1f04-e054-00144ff88e88' - }, - { - text: 'Trimipramine maleate capsules are indicated for the relief of symptoms of depression.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=4f31df66-7dc2-1f04-e054-00144ff88e88' - }, - { - text: 'OXYCODONE HCl EXTENDED-RELEASE TABLETS are indicated for the management of pain severe enough to require daily, around-the-clock, long-term opioid treatment and for which alternative treatment options are inadequate in: adults and Opioid-tolerant pediatric patients 11 years of age and older who are already receiving and tolerate a minimum daily opioid dose of at least 20 mg oxycodone orally or its equivalent', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=c5b52ff1-21a6-4d28-9982-55b4ac195fac' - }, - { - text: 'Clobazam tablet is indicated for the adjunctive treatment of seizures associated with Lennox-Gastaut syndrome (LGS) in patients 2 years of age or older.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=721dde68-db83-4dad-8649-8046cb455372' - }, - { - text: 'Perphenazine is indicated for use in the treatment of schizophrenia and for the control of severe nausea and vomiting in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=bb1a3d20-1f93-48a1-9e27-4712a8561757' - }, - { - text: 'In acute alcohol withdrawal, diazepam may be useful in the symptomatic relief of acute agitation, tremor, impending or acute delirium tremens and hallucinosis.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fa352464-14c8-49e9-b8b7-5a968b1cfa93' - }, - { - text: 'Fluphenazine Decanoate Injection, USP is a long-acting parenteral antipsychotic drug intended for use in the management of patients requiring prolonged parenteral neuroleptic therapy (e.g., chronic schizophrenics).', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=1967dc24-f2a5-4095-baa9-a9d1c5410311' - }, - { - text: 'Phenelzine Sulfate Tablets, USP has been found to be effective in depressed patients clinically characterized as atypical, nonendogenous, or neurotic.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=40483372-448f-4284-976c-8462ef256661' - }, - { - text: 'Milnacipran HCl tablets are indicated for the management of fibromyalgia.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=eaa14195-1b9c-423c-9412-d2fe0857e39d' - }, - { - text: 'Meprobamate tablets are indicated for the management of anxiety disorders or for the short-term relief of the symptoms of anxiety. Anxiety or tension associated with the stress of everyday life usually do not require treatment with an anxiolytic.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=3b255bcd-0218-44f8-830b-971f5ec45276' - }, - { - text: 'If these criteria are met and the patient has been fully advised of the risk, and has provided written acknowledgment, felbamate oral suspension can be considered for either monotherapy or adjunctive therapy in the treatment of partial seizures, with and without generalization, in adults with epilepsy and as adjunctive therapy in the treatment of partial and generalized seizures associated with Lennox-Gastaut syndrome in children', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2e325d79-d0a4-4af7-b09b-96ee5a5b2a37' - }, - { - text: 'For temporary relief of symptoms related to sleep disorders, Seasonal Affective Disorder, jet lag, and depression.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fdaf86c2-137d-4926-a63b-9faf7ec7e04c' - }, - { - text: 'For temporary relief of symptoms related to sleep disorders, Seasonal Affective Disorder, jet lag, and depression.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fdaf86c2-137d-4926-a63b-9faf7ec7e04c' - }, - { - text: 'EMGALITY is indicated for the treatment of episodic cluster headache in adults.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=33a147be-233a-40e8-a55e-e40936e28db0' - }, - { - text: 'For temporary relief of symptoms related to sleep disorders, Seasonal Affective Disorder, jet lag, and depression.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=fdaf86c2-137d-4926-a63b-9faf7ec7e04c' - }, - { - text: 'Eszopiclone Tablets are indicated for the treatment of insomnia.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=49f71eb4-15ca-42e2-b62b-7963cc8ef115' - }, - { - text: 'Zolpidem Tartrate Tablets is indicated for the short-term treatment of insomnia characterized by difficulties with sleep initiation', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=021153ce-fe27-4ed1-8d88-b4157b0ed734' - }, - { - text: 'Quazepam is indicated for the treatment of insomnia characterized by difficulty in falling asleep, frequent nocturnal awakenings, and/or early morning awakenings.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=f7d63f3f-5303-48ab-bce2-35fd62c45799' - }, - { - text: 'Hydrocodone bitartrate and acetaminophen tablets are indicated for the management of moderate to moderately severe pain severe enough to require an opioid analgesic and for which alternative treatments are inadequate.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=4f505b2a-45a2-4d34-96f6-dedb574cb508' - }, - { - text: 'Tramadol hydrochloride tablets are indicated for the management of moderate to moderately severe pain in adults', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ae7c54b1-b440-4cca-97e8-e5b825413d32' - }, - { - text: 'Trazodone hydrochloride tablets are indicated for the treatment of major depressive disorder (MDD) in adults', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=ed3039d8-3d27-4b71-a4b0-812943c9457f' - }, - { - text: 'Citalopram tablets are indicated for the treatment of depression', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2632b547-2e13-447f-ac85-c774e437d6a8' - }, - { - text: 'Paroxetine tablets are indicated for the treatment of major depressive disorder.', - url: 'https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=89dd7e24-85fc-4152-89ea-47ec2b48a1ed' - } -]; diff --git a/astro-frontend/src/utils/highlightjs-turtle.ts b/astro-frontend/src/utils/highlightjs-turtle.ts deleted file mode 100644 index ce47702..0000000 --- a/astro-frontend/src/utils/highlightjs-turtle.ts +++ /dev/null @@ -1,128 +0,0 @@ -'use client'; -/* -Language: Turtle -Author: Redmer KRONEMEIJER -Contributors: Mark ELLIS , Vladimir ALEXIEV -*/ - -// var module = module ? module : {}; // shim for browser use - -// function hljsDefineTurtle(hljs) { -export default function (hljs: any) { - var KEYWORDS = { - keyword: 'BASE|10 PREFIX|10 @base|10 @prefix|10', - literal: 'true|0 false|0', - built_in: 'a|0' - }; - - var IRI_LITERAL = { - // https://www.w3.org/TR/turtle/#grammar-production-IRIREF - className: 'literal', - relevance: 1, // XML tags look also like relative IRIs - begin: //, - illegal: /[^\x00-\x20<>"{}|^`]/ // TODO: https://www.w3.org/TR/turtle/#grammar-production-UCHAR - }; - - // https://www.w3.org/TR/turtle/#terminals - var PN_CHARS_BASE = - 'A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u10000-\uEFFFF'; - var PN_CHARS_U = PN_CHARS_BASE + '_'; - var PN_CHARS = '-' + PN_CHARS_U + '0-9\u00B7\u0300-\u036F\u203F-\u2040'; - var BLANK_NODE_LABEL = '_:[' + PN_CHARS_U + '0-9]([' + PN_CHARS + '.]*[' + PN_CHARS + '])?'; - var PN_PREFIX = '[' + PN_CHARS_BASE + ']([' + PN_CHARS + '.]*[' + PN_CHARS + '])?'; - var PERCENT = '%[0-9A-Fa-f][0-9A-Fa-f]'; - var PN_LOCAL_ESC = "\\\\[_~.!$&'()*+,;=/?#@%-]"; - var PLX = PERCENT + '|' + PN_LOCAL_ESC; - var PNAME_NS = '(' + PN_PREFIX + ')?:'; - var PN_LOCAL = - '([' + PN_CHARS_U + ':0-9]|' + PLX + ')([' + PN_CHARS + '.:]|' + PLX + ')*([' + PN_CHARS + ':]|' + PLX + ')?'; - var PNAME_LN = PNAME_NS + PN_LOCAL; - var PNAME_NS_or_LN = PNAME_NS + '(' + PN_LOCAL + ')?'; - - var PNAME = { - begin: PNAME_NS_or_LN, - relevance: 0, - className: 'symbol' - }; - - var BLANK_NODE = { - begin: BLANK_NODE_LABEL, - relevance: 10, - className: 'template-variable' - }; - - var LANGTAG = { - begin: /@[a-zA-Z]+([a-zA-Z0-9-]+)*/, - className: 'type', - relevance: 5 // also catches objectivec keywords like: @protocol, @optional - }; - - var DATATYPE = { - begin: '\\^\\^' + PNAME_LN, - className: 'type', - relevance: 10 - }; - - var TRIPLE_APOS_STRING = { - begin: /'''/, - end: /'''/, - className: 'string', - relevance: 0 - }; - - var TRIPLE_QUOTE_STRING = { - begin: /"""/, - end: /"""/, - className: 'string', - relevance: 0 - }; - - var APOS_STRING_LITERAL = JSON.parse(JSON.stringify(hljs.APOS_STRING_MODE)); - APOS_STRING_LITERAL.relevance = 0; - - var QUOTE_STRING_LITERAL = JSON.parse(JSON.stringify(hljs.QUOTE_STRING_MODE)); - QUOTE_STRING_LITERAL.relevance = 0; - - var NUMBER = JSON.parse(JSON.stringify(hljs.C_NUMBER_MODE)); - NUMBER.relevance = 0; - - return { - name: 'Turtle', - case_insensitive: true, // however `true` and `@prefix` are oblig. cased thus - keywords: KEYWORDS, - aliases: ['turtle', 'ttl', 'n3'], - contains: [ - LANGTAG, - DATATYPE, - IRI_LITERAL, - BLANK_NODE, - PNAME, - TRIPLE_APOS_STRING, - TRIPLE_QUOTE_STRING, // order matters - APOS_STRING_LITERAL, - QUOTE_STRING_LITERAL, - NUMBER, - hljs.HASH_COMMENT_MODE - ], - exports: { - LANGTAG: LANGTAG, - DATATYPE: DATATYPE, - IRI_LITERAL: IRI_LITERAL, - BLANK_NODE: BLANK_NODE, - PNAME: PNAME, - TRIPLE_APOS_STRING: TRIPLE_APOS_STRING, - TRIPLE_QUOTE_STRING: TRIPLE_QUOTE_STRING, - APOS_STRING_LITERAL: APOS_STRING_LITERAL, - QUOTE_STRING_LITERAL: QUOTE_STRING_LITERAL, - NUMBER: NUMBER, - KEYWORDS: KEYWORDS - } - }; -} - -// module.exports = function (hljs) { -// hljs.registerLanguage('turtle', hljsDefineTurtle); -// }; - -// module.exports.definer = hljsDefineTurtle; diff --git a/astro-frontend/src/utils/nanostores.ts b/astro-frontend/src/utils/nanostores.ts deleted file mode 100644 index 676888e..0000000 --- a/astro-frontend/src/utils/nanostores.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {atom} from 'nanostores'; - -interface UserProfile { - id?: string; - sub?: string; - username?: string; - name?: string; - given_name?: string; - family_name?: string; -} - -export const userProfile = atom({}); - -interface UserSettings { - api: string -} - -export const userSettings = atom({ - // api: process.env.NEXT_PUBLIC_API_URL ? process.env.NEXT_PUBLIC_API_URL : 'https://api.collaboratory.semanticscience.org' - api: 'https://api.collaboratory.semanticscience.org' -}) diff --git a/astro-frontend/src/utils/settings.ts b/astro-frontend/src/utils/settings.ts deleted file mode 100644 index 2ffc296..0000000 --- a/astro-frontend/src/utils/settings.ts +++ /dev/null @@ -1,197 +0,0 @@ -export const settings = { - frontendUrl: import.meta.env.PUBLIC_SITE_URL || 'http://localhost:3000', - apiUrl: import.meta.env.PUBLIC_API_URL || 'https://api.collaboratory.semanticscience.org', - docsUrl: - (import.meta.env.PUBLIC_API_URL ? import.meta.env.PUBLIC_API_URL + '/docs' : null) || - 'https://api.collaboratory.semanticscience.org/docs', - nanopubGrlcUrl: 'https://grlc.np.dumontierlab.com/api/local/local', - ontogptUrl: 'http://localhost:8001/extract', - nanopubSparqlUrl: 'https://virtuoso.nps.petapico.org/sparql', - orcidClientId: import.meta.env.ORCID_CLIENT_ID || 'APP-TEANCMSUOPYZOGJ3', - basePath: import.meta.env.PUBLIC_BASE_URL || '' -}; - -export const genericContext = { - rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - rdfs: 'http://www.w3.org/2000/01/rdf-schema#', - biolink: 'https://w3id.org/biolink/vocab/', - infores: 'https://w3id.org/biolink/infores/', - dct: 'http://purl.org/dc/terms/' -}; - -// https://purl.org/np/RAuN1kyW1BD9754LCUVWozDOhkrUaLUyb5LTu0HcsulIE -export const samples: any = { - 'Drug indication with the BioLink model': { - '@context': 'https://raw.githubusercontent.com/biolink/biolink-model/master/context.jsonld', - '@wizardQuestions': { - 'rdf:subject': 'Subject of the association:', - 'rdf:predicate': 'Predicate of the association:', - 'rdf:object': 'Object of the association:', - 'biolink:provided_by': 'Association provided by dataset:', - 'biolink:publications': 'Publication supporting the association:', - 'biolink:association_type': 'Type of the association:', - 'biolink:relation': 'Type of drug indication:', - 'biolink:has_population_context': 'Population context of the drug indication:' - }, - '@type': 'rdf:Statement', - 'rdfs:label': - 'An atypical drug is now increasingly used as an off-label indication for the management of cancer patients', - 'rdf:subject': { - '@id': 'https://go.drugbank.com/drugs/DB00334', - '@type': 'biolink:Drug' - }, - 'rdf:predicate': { - '@id': 'biolink:treats' - }, - 'rdf:object': { - '@id': 'https://identifiers.org/HP:0002017', - '@type': 'biolink:Disease' - }, - 'biolink:association_type': { - '@id': 'biolink:ChemicalToDiseaseOrPhenotypicFeatureAssociation' - }, - 'biolink:relation': {'@id': 'https://w3id.org/um/neurodkg/OffLabelIndication'}, - 'biolink:provided_by': {'@id': 'https://w3id.org/um/NeuroDKG'}, - 'biolink:publications': {'@id': 'https://pubmed.ncbi.nlm.nih.gov/29061799/'}, - 'biolink:has_population_context': { - 'rdfs:label': 'Adults', - 'biolink:category': {'@id': 'biolink:Cohort'}, - 'biolink:has_phenotype': { - '@id': 'https://identifiers.org/MONDO:0004992', - '@type': 'biolink:Phenotype' - } - } - }, - 'Dataset summary with schema.org': { - '@context': 'https://schema.org', - '@wizardQuestions': { - name: 'Provide the name of this entity:', - description: 'Give a short description of the content:', - creator: 'Provide the details of the person who created, or initiated, the creation of this work:', - contributor: 'Other persons who contributed to, or co-authored, the dataset:', - publisher: 'Person, or organization, who published this work:', - inLanguage: - 'What language is used in the description of this dataset? Use ISO 2 language code e.g. EN for English', - version: 'What is the version number for this dataset? e.g. 1.1.1 or v1.2', - license: 'Link to the full text of the terms of use (license) for this dataset:', - encodingFormat: 'What is the file format of this data?', - url: 'Link to the website or homepage:', - temporalCoverage: - 'What is the creation or publishing date range for the documents or contents of this dataset? Use https://en.wikipedia.org/wiki/ISO_8601#Time_intervals format - e.g. 2007-03-01/2008-05-11:', - keywords: 'Provide keywords describing the content in this dataset:', - distribution: 'Supply a direct download link for this dataset:', - contentSize: 'How large is the download file size e.g. 128KB, 54MB, 1.5GB?', - isBasedOn: 'Was this dataset generated with the aid of or using a piece of software?', - applicationCategory: 'Indicate type of software e.g. Python script or Java GUI application:', - citation: 'Is there an academic publication which describes or centrally makes use of this dataset?', - datePublished: 'On what date was the dataset published? YYYY-MM-DD', - dateCreated: 'On what date was the dataset created? YYYY-MM-DD', - affiliation: 'This person is affiliated to or employed by:', - logo: 'Link to an image depicting the logo of this organisation:', - image: 'Provide a link (URL) to a profile photo of the author of the dataset:', - sameAs: 'Provide a Digital Object Identifier (DOI) for this publication:', - frequency: 'How often does a new version get published for this dataset? e.g. daily, weekly, monthly' - }, - '@type': 'Dataset', - name: 'ECJ case law text similarity analysis', - description: - 'results from a study to analyse how closely the textual similarity of ECJ cases resembles the citation network of the cases.', - version: 'v2.0', - url: 'https://doi.org/10.5281/zenodo.4228652', - license: 'https://www.gnu.org/licenses/agpl-3.0.txt', - encodingFormat: 'CSV', - temporalCoverage: '2019-09-14/2020-07-01', - dateCreated: { - '@type': 'Date', - '@value': '2019-09-14' - }, - datePublished: { - '@type': 'Date', - '@value': '2020-07-01' - }, - distribution: { - '@type': 'DataDownload', - contentUrl: { - '@type': 'URL', - '@value': 'https://zenodo.org/record/4228652/files/docona_cjeu_results_2018_v2_html.zip?download=1' - }, - encodingFormat: 'application/zip', - contentSize: '1.1MB' - }, - inLanguage: { - '@type': 'Language', - name: 'EN', - alternateName: 'EN' - }, - keywords: ['case law', 'court decisions', 'text similarity', 'network analysis'], - creator: { - '@type': 'Person', - name: 'concat @givenName @familyName', - givenName: 'Kody', - familyName: 'Moodley', - image: - 'https://www.maastrichtuniversity.nl/sites/default/files/styles/text_with_image_mobile_portrait/public/profile/kody.moodley/kody.moodley_photo_kmoodley.jpg?itok=bN7b8s_-×tamp=1583505301', - jobTitle: 'Postdoctoral researcher', - email: 'kody.moodley@maastrichtuniversity.nl', - affiliation: { - '@type': 'Organization', - name: 'Maastricht Law & Tech Lab', - url: { - '@type': 'URL', - '@value': 'https://www.maastrichtuniversity.nl/about-um/faculties/law/research/law-and-tech-lab' - }, - logo: { - '@type': 'ImageObject', - contentUrl: - 'https://www.maastrichtuniversity.nl/sites/default/files/styles/page_photo/public/compacte20versie20law20and20tech20lab.jpg?itok=7lm6PEQF' - } - } - }, - contributor: [ - { - '@type': 'Person', - givenName: 'Pedro', - familyName: 'Hernandez Serrano', - jobTitle: 'Data Scientist', - email: 'p.hernandezserrano@maastrichtuniversity.nl', - image: - 'https://www.maastrichtuniversity.nl/sites/default/files/styles/text_with_image_mobile_portrait/public/profile/p.hernandezserrano/p.hernandezserrano_PP%20%287%20of%2013%29.jpg?itok=IUdreoIw×tamp=1610395201', - affiliation: { - '@type': 'Organization', - name: 'Institute of Data Science', - url: { - '@type': 'URL', - '@value': 'https://www.maastrichtuniversity.nl/research/institute-data-science' - }, - logo: { - '@type': 'ImageObject', - contentUrl: 'https://avatars.githubusercontent.com/u/36262526?s=280&v=4' - } - } - } - ], - publisher: { - '@type': 'Person', - name: 'Kody Moodley', - givenName: 'Kody', - familyName: 'Moodley', - jobTitle: 'Postdoctoral researcher', - image: - 'https://www.maastrichtuniversity.nl/sites/default/files/styles/text_with_image_mobile_portrait/public/profile/kody.moodley/kody.moodley_photo_kmoodley.jpg?itok=bN7b8s_-×tamp=1583505301', - email: 'kody.moodley@maastrichtuniversity.nl', - affiliation: { - '@type': 'Organization', - name: 'Maastricht Law & Tech Lab', - url: { - '@type': 'URL', - '@value': 'https://www.maastrichtuniversity.nl/about-um/faculties/law/research/law-and-tech-lab' - }, - logo: { - '@type': 'ImageObject', - contentUrl: - 'https://www.maastrichtuniversity.nl/sites/default/files/styles/page_photo/public/compacte20versie20law20and20tech20lab.jpg?itok=7lm6PEQF' - } - } - } - } -}; diff --git a/astro-frontend/src/utils/utils.ts b/astro-frontend/src/utils/utils.ts deleted file mode 100644 index 115fe2a..0000000 --- a/astro-frontend/src/utils/utils.ts +++ /dev/null @@ -1,76 +0,0 @@ -// import React from "react"; -// // // const $rdf = require('rdflib') -// import $rdf from 'rdflib'; -// // const $rdf = require('rdflib') -// import { genericContext } from './settings'; - -// NOT USED, it's in Layout.astro -export const theme = { - palette: { - primary: {light: '#6ec6ff', main: '#2196f3', dark: '#0069c0'}, // blue - secondary: {light: '#76d275', main: '#43a047', dark: '#00701a'} // green - // default: { light: '#fafafa', main: '#eceff1', dark: grey[600] } - // success: { light: '#ffe0b2', main: '#a5d6a7', dark: '#00600f' }, // green - // info: { light: '#b3e5fc', main: '#81d4fa', dark: '#00600f' }, // blue - // warning: { light: '#c8e6c9', main: '#ffcc80', dark: '#00600f' }, // orange - // error: { light: '#ffcdd2', main: '#ef9a9a', dark: '#e57373' }, // red - }, - typography: { - fontFamily: '"Open Sans", "Roboto", "Arial"', - fontWeightLight: 300, - fontWeightRegular: 400, - fontWeightMedium: 500, - fontSize: 11 - } - // spacing: 2 -}; - -// export const rdfToRdf = (data: any, output: string = 'text/turtle', input: string = 'application/ld+json') => { -// // Convert RDF to JSON-LD using rdflib -// // let rdf_format = 'application/rdf+xml'; -// // if (uri.endsWith('.ttl')) rdf_format = 'text/turtle' -// // if (uri.endsWith('.nq')) rdf_format = 'application/n-quads' -// // // Or text/x-nquads -// // if (uri.endsWith('.nt')) rdf_format = 'application/n-triples' -// // if (uri.endsWith('.n3')) rdf_format = 'text/n3' -// // if (uri.endsWith('.trig')) rdf_format = 'application/trig' -// const baseUri = 'http://w3id.org/collaboratory/' -// return new Promise((resolve, reject) => { -// let store = $rdf.graph() -// // let doc = $rdf.sym(base_uri); -// $rdf.parse(JSON.stringify(data), store, baseUri, input) -// // console.log(store) -// $rdf.serialize(genericContext, store, baseUri, output, (err: any, rdfOutput: any) => { -// return resolve(rdfOutput) -// }) -// }) -// } - -// export const toJSONLD = (data: any, uri: any) => { -// // Convert RDF to JSON-LD using rdflib -// let rdf_format = 'application/rdf+xml'; -// if (uri.endsWith('.ttl')) rdf_format = 'text/turtle' -// if (uri.endsWith('.nq')) rdf_format = 'application/n-quads' -// // Or text/x-nquads -// if (uri.endsWith('.nt')) rdf_format = 'application/n-triples' -// if (uri.endsWith('.n3')) rdf_format = 'text/n3' -// if (uri.endsWith('.trig')) rdf_format = 'application/trig' -// return new Promise((resolve, reject) => { -// let store = $rdf.graph() -// let doc = $rdf.sym(uri); -// $rdf.parse(data, store, uri, rdf_format) -// // console.log(store) -// $rdf.serialize(doc, store, uri, 'application/ld+json', (err: any, jsonldData: any) => { -// return resolve(JSON.parse(jsonldData) -// .sort((a: any, b: any) => { -// if (a['@type'] && b['@type'] && Array.isArray(a['@type']) && Array.isArray(b['@type'])){ -// // Handle when array of types provided (e.g. SIO via rdflib) -// return a['@type'][0] < b['@type'][0] ? 1 : -1 -// } else { -// return a['@type'] < b['@type'] ? 1 : -1 -// } -// }) -// ) -// }) -// }) -// } diff --git a/astro-frontend/tailwind.config.cjs b/astro-frontend/tailwind.config.cjs deleted file mode 100644 index 71d9c84..0000000 --- a/astro-frontend/tailwind.config.cjs +++ /dev/null @@ -1,48 +0,0 @@ -/** @type {import('tailwindcss').Config} */ - -// NOT USED at the moment, too many conflict with current styling -// Astro + Tailwind template: https://github.com/onwidget/astrowind -module.exports = { - content: ['./src/**/*.{astro,html,js,jsx,mdx,svelte,ts,tsx,vue}'], - darkMode: 'class', - theme: { - fontFamily: { - sans: ['Roboto', 'sans-serif'] - // serif: ['Merriweather', 'serif'], - }, - fontSize: { - sm: '0.8rem', - base: '1rem', - xl: '1.25rem', - '2xl': '1.563rem', - '3xl': '1.953rem', - '4xl': '2.441rem', - '5xl': '3.052rem' - }, - extend: { - colors: { - primary: 'var(--color-primary)', - secondary: 'var(--color-secondary)', - accent: 'var(--color-accent)' - } - // fontFamily: { - // sans: ['var(--aw-font-sans)', ...defaultTheme.fontFamily.sans], - // serif: ['var(--aw-font-serif)', ...defaultTheme.fontFamily.serif], - // heading: ['var(--aw-font-heading)', ...defaultTheme.fontFamily.sans], - // }, - // spacing: { - // '128': '32rem', - // '144': '36rem', - // }, - // borderRadius: { - // '4xl': '2rem', - // } - } - }, - // corePlugins: { - // margin: false, - // fontSize: false, - // fontWeight: false, - // }, - plugins: [require('@tailwindcss/typography')] -}; diff --git a/astro-frontend/tsconfig.json b/astro-frontend/tsconfig.json deleted file mode 100644 index b7243b9..0000000 --- a/astro-frontend/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "astro/tsconfigs/strict", - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "react" - } -} diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 6d27592..5b4e528 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -25,6 +25,7 @@ export default function BrowseNanopub() { const theme = useTheme() const resourceTypesList: any = [ + {label: 'All nanopublications', uri: 'All nanopublications'}, {label: 'PREDICT reference dataset', uri: 'http://purl.org/np/RAWWaT9M_Nd8cVm_-amJErz60Ak__tkS6ROi2P-swdmMw'}, { label: 'Off-Label drug indication dataset', @@ -34,7 +35,6 @@ export default function BrowseNanopub() { label: 'Claims published with Annotate biomedical text', uri: 'https://w3id.org/biolink/infores/knowledge-collaboratory' }, - {label: 'All nanopublications', uri: 'All nanopublications'} ] const users_pubkeys: any = {} const nanopub_obj: any = {} @@ -159,10 +159,11 @@ export default function BrowseNanopub() { } }` } - } else { - // By default we show all nanopubs in the Knowledge Collaboratory - assertionBlocks.push(`?association biolink:aggregator_knowledge_source <${knowledgeProvider}> .`) } + // else { + // // By default we were showing all nanopubs in the Knowledge Collaboratory. Not anymore (there no new, so we just show all nanopubs) + // assertionBlocks.push(`?association biolink:aggregator_knowledge_source <${knowledgeProvider}> .`) + // } let assertionGraphBlock = '' if (assertionBlocks.length > 0) {