Jose Emilio Labra Gayo
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- title: 'Enhancement and Reusage of Biomedical Knowledge Graph Subsets' title_short: 'Enhancement and reuse of Knowledge Grpahs' tags: - Wikidata - ShEx - RDF - Knowledge graphs authors: - name: Jose Emilio Labra Gayo orcid: 0000-0001-8907-5348 affiliation: 1 - name: Ammar Ammar affiliation: 2 - name: Dan Brickley affiliation: 3 - name: Eric Prud'hommeaux orcid: 0000-0003-1775-9921 affiliation: 5 - name: Seyed Amir Hosseini Beghaeiraveri orcid: 0000-0002-9123-5686 affiliation: 4 - name: Carolina González-Cavazos affiliation: 8 - name: Sabah Ul-Hasan affiliation: 8 - name: Andra Waagmeester affiliation: 7 - name: Nils Hoffmann affiliation: 9 affiliations: - name: WESO research group, University of Oviedo, Spain index: 1 - name: Maastricht University index: 2 - name: Google, London, UK index: 3 - name: Heriot-Watt University, UK index: 4 - name: Janeiro Digital, W3C/MIT index: 5 - name: Micelio/Gene Wiki index: 7 - name: Gene Wiki Project, Scripps Research Institute index: 8 - name: Nils affiliation index: 9 date: 11 November 2022 bibliography: paper.bib event: BH22EU group: Enhancement and Reusage of Biomedical Knowledge Graph Subsets authors_short: Jose E. Labra \emph{et al.} --- # Enhancement and Reusage of Biomedical Knowledge Graph Subsets ## Abstract Knowledge Graphs (KGs) such as Wikidata act as a hub of information from multiple domains and disciplines, and is crowdsourced by multiple stakeholders. The vast amount of available information makes it difficult for researchers to manage the entire KG, which is also continually being edited and changing its content. It is necessary to develop tools that extract snapshots and subsets for some specific domains of interest. These subsets help researchers by reducing costs and ease accessbility to data of interest. In the last two biohackathons, we have identified this issue and created prototypes to extract subsets easily applicable to Wikidata, as well as to define a map of the different approaches used to tackle this problem. Building on those outcomes, we aim to enhance subsetting in both definitions using Entity schemas based on Shape Expressions and extraction algorithms, with a special focus on the biomedical domain captured by entity schemas like the one defined in the GeneWiki project. Our first aim is to develop complex subsetting patterns to cover subsetting based on qualifiers and references for enhancing credibility of datasets. Our second aim is to establish a faster subsetting extraction platform applying new algorithms based on Apache Spark and new tools like a document-oriented DBMS platform. During this biohackathon, we aim to explore reuse workflows of Wikidata subsets specifically with respect to drug repurposing. The biohackathon will assist in an evaluation of existing nodes and edges on drug-target interactions categories within Wikidata, and if these are in need of updates as well as deeper annotation. We would also aim to deliver machine readable schemas of drug-target interactions in Wikidata for future data reuse. ## Report about project 11 at Biohackathon-Europe 2022 ## Links - [HackMD notes](https://hackmd.io/@vfttImB6SdiREhh65hglIA/SykVQELBi/edit) - [notes from 2021 (Barcelona)](https://hackmd.io/gHHasGifTEaDMdvM9LTxTQ) # Fourth day 10th-Nov-2022 ## Attendants - Seyed - Carolina - Ammar - Labra ## Notes - Labra - Published dataset about GeneWiki in Zenodo: https://doi.org/10.5281/zenodo.7309739 - Waiting for the other subsets that are being generated: more than 20hours...don't know why - Uploaded to a local Fuseki SPARQL endpoint the GeneWiki dataset and seems to work: ``` PREFIX ps: <https://w3id.org/payswarm#> prefix geo: <http://www.opengis.net/ont/geosparql#> prefix p: <http://www.wikidata.org/prop/> prefix pq: <http://www.wikidata.org/prop/qualifier/> prefix pr: <http://www.wikidata.org/prop/reference/> prefix prov: <http://www.w3.org/ns/prov#> prefix ps: <http://www.wikidata.org/prop/statement/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix schema: <http://schema.org/> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix wd: <http://www.wikidata.org/entity/> prefix wdno: <http://www.wikidata.org/prop/novalue/> prefix wds: <http://www.wikidata.org/entity/statement/> prefix wdt: <http://www.wikidata.org/prop/direct/> prefix wikibase: <http://wikiba.se/ontology#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> SELECT * WHERE { ?cellular_component wdt:P702 ?gene . OPTIONAL { ?cellular_component rdfs:label ?ccLabel . } OPTIONAL { ?gene rdfs:label ?geneLabel . } filter( lang(?ccLabel)='en' # && lang(?ccLabel)='es' ) } ``` It obtained 365 results - Ammar - Created a subset with lipids using the WholeEntity and this [Shape Expression](https://github.com/kg-subsetting/biohackathon2022/blob/main/workflows/wdsub-lipids/lipids.shex) - 1.6Gb gzipped, 8.4Gb unzipped - Trying to guess if the problem is the OR in the ShEx that seems to ignore the first part...maybe to version 0.0.29 of wdsub could solve it. - We are going to create a new subset using this simplified ShEx - Ammar will help publishing the Zenodo dataset in Turtle in a public SPARQL endpoint with a given IP so we can do SPARQL queries on it... - Seyed - Script to count number of instance between WDF and WDSub but it didn't work - Trying to check which items were extraced by one and not the other... - One was created with C and the other with Blazegraph - 600 items in wdf that are not in wdsub - Carolina will try to help there - Carolina - Waiting for the JSON results to analyze them using some link prediction algorithms... - Started to look at processing turtle rdflib - Will take a look at the differences reported by Seyed and the Python code - RDF2vec library could be used for this: http://rdf2vec.org/ - Q. How is the embedding happening? - Random walks...random visits of the nodes... - Train neural network with those connections... - Principal components labelled with the class... - One issue could be to rewrite from wdt:P31 to rdf:type - Fact validation with KG embeddings - https://ceur-ws.org/Vol-2456/paper33.pdf - Semantic Answer Type prediction (ISWC 2020-2021) - http://ceur-ws.org/Vol-2774/paper-05.pdf - http://ceur-ws.org/Vol-3119/paper7.pdf ## Meeting at 16h on 10th nov 2022 Ammar took the GeneWiki subset previously generated and published it a Virtuoso TripleStore with a public SPARQL endpoint. After that, we were able to create several SPARQL queries to analyse the extracted subset. - Some example queries are the following: - We were discussing about the publication of the results of the biohackathon and decided the following: - Publish biohackarxiv report of last year's which we had left as a draft unpublished in the next weeks - Try to publish a first draft of the biohackarxiv report tomorrow. - We started a discussion about possible reproducibility pipelines - Embed docker invocation in a Jupyter notebook. This option requires infrastructure to host the Jupyter notebooks. - Embed a Jupyter notebook in a docker container. This is possible using [DataScience Notebook](https://hub.docker.com/r/jupyter/datascience-notebook). - Another possibility could be to use a Workflow language like [SnakeMake](https://snakemake.readthedocs.io/en/stable/). - Next steps: - Have the subsets online and update them periodically. Ammar will consult the availability of resources. - Requirements and challenges to consider - Updating the shapes. - Regularly downloading dumps, something like a cron script and updating the subset. - Save the shape expression in a github repo and take the latest version from there. - Trying to implement a: Wikidata subsetting as a Service - 2 possibilities: - Curated list of Shape Expressions/subsets that are regularly generated for specific purposes. - A service like WDumper that takes as input a Shape Expression - Types of analysis that we can perform on the subsets: - Link prediction/classification. Drug prediction - Analyzing data quality: references and qualifiers...subsets can be considered as samples of wikidata to investigate the quality of the data. - Future use cases: - Subsets as starting points as a seed to create new knowledge graphs, integrating their information with other sources. One example, could be mapping with data from other ontologies, KGs, etc. Another use case is bioschemas. - Visualization of subsets which can be specific for some domain. - Use cases about using subgraphs for machine learning/deep learning/question answering algorithms...help NLP algorithms. # Third day 9th-Nov-2022 ## Attendants - Seyed - Jose Labra - Andra - Ammar - Carolina ## Notes - Explanation about wdsub - Input JSON dumps - Output: you can choose between JSON or Turtle - The dataset generated yesterday from Genewiki seems to generate only taxons... - Maybe the reason is that the JSOn output generation has some bug - Ammar used the ShEx for the lipids with wdsub library and used it with the 2014...it took less than an hour - 64M zipped, 492 Mb unzipped - Only contains the taxon entities...maybe the same bug? - Upload the dataset of lipids to another Zenodo - Andra: - wdsub seems to run - shape expressions with classes and identifiers... - error messages - somevalues/novalues are not implemented yet - geocoordinates which should not be in genewiki - took a long time: - 14 hours more or less - 610Mb - Detect problems in wikidata - taxon is not a taxon but a taxon name - multiple wikidata items for the same taxon - problem with bacteria and viruses - targeted subsets - taxon subset... - Carolina: - GeneWiki subset but seems to contain only taxons - Github: https://github.com/kg-subsetting/biohackathon2022/blob/main/examples/ShEx/geneWiki.shex - Apply the subset to machine learning algorithm that she has (Case-Based reasoning). - Apply her algorithm to this subset for drug repurpusing. - Seyed: - Checking the number of extracted outputs - WDF: Wikibase dump filter - Dumpformat = JSON - both tools miss some gene instances ~ 4000 instances - wdsub miss 600 more - List of items that are in one and not in the other - Analyzing accuracy, which is important - Labra - Created the GeneWiki subset using the GeneWiki.shex using JSON output for 2018 - Create the script to obtain - GeneWiki of 2018 in Turtle - GeneWiki of 2022 in Turtle - GeneWiki of 2022 in Json - Still running (more than 12 hours) - Publish in Zenodeo - Possibilities to upload the datasets - github repo for datasets: https://github.com/kg-subsetting/datasets-biohackathon2022 - Zenodo: already done, limit of 50G - Dryad: maybe for the latest version for the paper, because the datasets are reviewed - data.world - Examples from book: https://data.world/swwo - tryplydb ? - Discuss the workflow and automate the creation of subset - Wikidata Subsets as as Service - Enter a entity schema and obtain a subset - wdsub is a command line tool with docker support - Andra was able to do it in a laptop (slimbook) - We could wrap it into a web service - It would be great to have a server host as WDumper - https://wdumps.toolforge.org/dumps - Options - Command line - Generic web service - Pre-defined subsets - Fix set of curated shape expressions - cron job to run that service... - Wikidata + quality control - Other tools apart from wdsub - Ammar reminds that he created a subset for lipids using pyshex and slurper # Second day 8th-Nov-2022 ## Attendants - Seyed - Jose Labra - Andra ## Notes - Seyed, created a subset which contains instances of Genes, Proteins, etc. and put the output (turtle) in a Blazegraph - Dumps from: 3 January 2022 [Link]( https://academictorrents.com/details/229cfeb2331ad43d4706efd435f6d78f40a3c438) - SPARQL counting: - Gene: 1196517 - Protein: 987614 - Chemical compound: 1244866 - Disease: 5512 - Andra [created an example](https://github.com/kg-subsetting/biohackathon2022/blob/main/examples/ShEx/gene.shex) of a ShEx to extract info related with Genes but that is more inclusive than just checking the P31 Q7187, including all things that have at least some specific properties... ``` <Gene> @<TypedGene> OR @<PropertyBasedGene> <TypedGene> EXTRA p:P31 { p:P31 { ps:P31 [wd:Q7187]} } <PropertyBasedGene> { p:P351 { ps:P351 . } + OR { p:P353 { ps:P353 . } + OR . . . } ``` - Ammar is planning to work on a subset related with lipids using a ShEx like the following: ``` PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX : <http://bigcat.unimaas.nl/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> start= @:lipids OR @:taxon :lipids { wdt:P2063 .+; wdt:P234 .+; wdt:P235 .+; wdt:P703 @:taxon +; } :taxon { wdt:P31 [wd:Q16521]; } ``` ``` #!/bin/sh Version=0.0.26 Dump2018=wikidata-20180115-all # Local Downloaded dump from Wikidata Name=taxons DumpFile=${Dump2018} SchemaFormat=ShExC DumpMode=OnlyMatched DumpFormat=Turtle docker run -d -v /home/labra/dumps:/data -v /home/labra/wdsubConfig/shex:/shex -v /home/labra/generatedDumps:/generatedDumps wesogroup/wdsub:${Version} dump -o /generatedDumps/${Name}.ttl.gz -s /shex/${Name}.shex /data/${DumpFile}.json.gz --dumpFormat ${DumpFormat} --dumpMode ${DumpMode} --schemaFormat ${SchemaFormat} ``` Ideas talking with Carolina during lunch - Create a subset based on her [ShEx](https://github.com/kg-subsetting/biohackathon2022/blob/main/examples/ShEx/geneWiki.shex) - Review JSON structure of the subsets - Once we get the subset, apply some Machine Learning algorithms... - Link prediction? - We started to run wdsub using Carolina's ShEx which contains information about GeneWiki. The shape we used was [this one](https://github.com/kg-subsetting/biohackathon2022/blob/main/examples/ShEx/geneWiki.shex) - [Link to some past results from Labra's students]( https://docs.google.com/document/d/1mxEo6y4IJjVpDK1nT2PvcvkFgvTCLBJax6WipTMXCUM/edit#heading=h.9ywt0nihccfc) - # First day 7th-Nov-2022 ## Attendants - Jose Labra - Andra Waagmeester - Eric Prud'hommeaux - Carolina Gonzalez - Sayed Beghaei ## Notes - During the break I met Egon and were talking about possibility of creating a subset about Chemistry - Idea: prepare a tutorial to explain how to create subsets using wdsub - Andra: plan for the week - Expectations - Finish the paper that we started last year - Create subsets for GeneWiki - What to do with the subset - Issue to solve: Where to store the created subset - [Dryad](https://datadryad.org/stash) - Seyed same expectations - Expressivity of wdsub is constrained by sequential processing for each line...it checks each item # Gameplan * Andra: Revisit the wdsubset of genewiki subgraph * This involves support for qualifiers and references Example of things supported in wdsub: ``` start = @<Gene> OR @<Disease> OR ... <Gene> EXTRA wdt:P31 { wdt:P31 [ wd:Q7187 ....] ; # Don't follow this pattern: wdt:P31 . * ; wdt:P703 # References are supported but not validated :encodes @<Protein> ; # Qualifiers... p:P166 { ps:P166 @<Award> ; pq:P585 xsd:dateTime ? ; pq:P1706 @<Researcher> * } * } <Disiease> { } <Protein> { wdt:p31 [....] } ``` ``` start = @<Gene_by_ontology> OR @<Gene_by_identifier> <Gene_by_ontology> { p:P31 { ps:P31 [wd:Q7187] ; prov:wasDerivedFrom . ; } p:P703 { ps:P703 [wd:homo sapiens] ; prov:wasDerivedFrom . ; } } <Gene_by_identifier> { p: } ``` Seyed's question: What is the difference between these (in terms of extracting subset via WDSub)?: 1) ``` start = @<Gene> OR @<Disease> OR <Protein> <Gene> EXTRA wdt:P31 { wdt:P31 [ wd:Q7187] ; } <Disiease> { wdt:p31 [wd:Qabc] } <Protein> { wdt:p31 [wd:Qijk] } ``` and 2) ``` start = @<all> <all> EXTRA wdt:P31 { wdt:P31 [ wd:Q7187, wd:Qabc, wd:Qijk] ; } ``` - Meeting with virtual attendees, tomorrow at 10h CET https://github.com/kg-subsetting/biohackathon2022 - Andra: will work on preparing some examples about GeneWiki - Seyed: Check if the tool finnished and review the output of wdsub. - Report about the possible turtle output - Carolina has some Shape Expressions about GeneWiki (add more properties) - Labra will continue checking the tool and update docker image ``` run dump -s schema.shex --schemaFormat ShExC -o target/exampleReferences.ttl.gz input.json.gz --dumpMode OnlyMatched --dumpFormat Turtle ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully