Showing posts with label wikipedia. Show all posts
Showing posts with label wikipedia. Show all posts

Friday, June 16, 2017

Building communities of knowledge with Wikidata

As the Wikimedia Movement works to define its strategy for the next fifteen years, it is worthwhile to consider how its recent product Wikidata may fit into that strategy.  As its homepage states,

Wikidata is a free and open knowledge base that can be read and edited by both humans and machines.” https://www.wikidata.org/

Wikidata is a particular kind of database designed to capture statements about items in the world with references that support those statements.  Because Wikidata is a database, its contents are meant to be viewed in the context of software that retrieve the data through queries and then renders the data to meet the needs of a user in a certain context.  The same data can thus be viewed on Wikidata-specific pages such as https://www.wikidata.org/wiki/Q13561329 and in the infoboxes of Wikipedia articles such as https://en.wikipedia.org/wiki/Reelin.  Importantly, Wikidata content can also be used in applications outside of the Wikimedia family such as http://wikigenomes.org.   

Examples of Wikidata use now include:

The molecular biology community (and in particular the Gene Wiki group) has embraced Wikidata as a global platform for knowledge integration and distribution.  To help envision how Wikidata may fit into the strategic vision of the WMF movement, it is worth taking a look at how and why this particular community is using Wikidata.  

History of the Gene Wiki initiative
The sequencing of the human genome at the beginning of this century and the consequent rush of data and new technology for producing even more data fundamentally changed how research in biology is conducted.  Before the year 2000, research typically proceeded with a single gene focus.  A typical PhD thesis would entail the analysis of the genetics or function of one gene or protein at a time.  A few years after the first genome however, it became possible to measure the activity of ten’s of thousands of genes at once resulting in an omnipresent problem of generating interpretations of experimental results containing hundreds of genes.  While a scientist may come to grasp the literature surrounding a single gene quite well, it is not possible to know everything there is to know about all 20,000+ genes in the genome - particularly when this knowledge is expanding on a minute by minute basis.  As a consequence, there arose a need to produce summaries of what was known about each gene so that researchers could quickly grasp its nature and easily find links to more detailed references as needed.  By 2008, many different research groups published wikis attempting to allow the scientific community to generate the required articles, e.g. WikiProteins, WikiGenes, and the Gene Wiki.  The Gene Wiki project was unique among this group as it anchored itself directly to Wikipedia and, likely as a result of that decision, has enjoyed long term success.  This initiative works within the English Wikipedia community to encourage and support the collection of articles about human genes.  Its main contributions are the infobox seen on the right hand side of of these articles and software for generating new article stubs using that template.  

Wikidata and the Gene Wiki project

For the past several years, the Gene Wiki core team (funded by an NIH grant) has focused primarily on seeding Wikidata with biomedical knowledge.  In comparison to managing data via direct inclusion and parsing of infobox templates as before, this makes the data much easier to maintain automatically and, importantly, opens it up for use by other applications.  As a result, Wikipedia isn’t the only application that can use this structured information.   One of the first products of that process was a new module (Infobox_gene) that draws all the needed data to render the gene infobox dynamically from Wikidata, greatly reducing the technical challenge of keeping the data presented there in sync with primary sources.  

In addition to the relatively simple collection of gene identifiers and links off to key public databases that are presented in the infoboxes, Wikidata now has an extensive and growing network of knowledge linking genes to proteins, proteins to drugs, drugs to diseases, diseases to pathogens, pathogens to places, places to events, events to people, and so on and so on.  This unique, open, referenced, knowledge graph may eventually become the closest thing to ‘the sum of all human knowledge’.  Capturing knowledge in this structured form makes it possible to use it in all kinds of applications, each with their own community-specific user experiences.  As a case in point, the Gene Wiki group created Wikigenomes based primarily on data loaded into Wikidata.  This was followed quickly by Chlambase, an application specifically focused on distributing and collecting knowledge about different Chlamydia genomes.  These applications provide domain-specific user interface components such as genome browsers that are needed to present the relevant information effectively and thereby attract the attention of specialist users.  These users, in turn, have the opportunity to contribute their knowledge back to the broader community through contributions to Wikidata that can be mediated by the same software.  

Wikidata and the world
The molecular biology research community, as represented by the Gene Wiki project, are early adopters of Wikidata as a community platform for the collaborative curation and distribution of structured knowledge, but they are not alone.  The same fundamental patterns are already being applied by other communities, e.g. those interested in digital preservation and open bibliography.  In each case, we see communities working to transition from the current dominant paradigm of private knowledge management towards the knowledge commons approach made possible by wikidata.  This is not unlike the transition from the world of the Encyclopedia Britannica to the world of Wikipedia.  The only important difference is that the knowledge in question is structured in a way that makes it easier to reuse in different ways and in different applications.  


Wikidata provides a mechanism for massively increasing the global good generated by the Wikimedia Foundation’s work by capturing knowledge in a form that can be agilely used to empower all manner of software with the sum of human knowledge.  

Wednesday, October 21, 2015

Poof it works - using wikidata to build Wikipedia articles about genes

Infobox for ARF6,
rendered entirely from
content Wikidata
The Gene Wiki team has been hard at work filling wikidata with useful content about genes, diseases, and drugs using the new and improved ProteinBoxBot.  Now, we are starting to see the fruits of this labor in the context of Wikipedia.

The Gene Wiki project has programmatically created and maintained the infoboxes to the right of all the articles in Wikipedia about human genes since about 2008 [Huss 2008].  This process has entailed the construction of a unique template containing all of the relevant data for each gene.  For example, here is the code for the template for the ARF6 gene.  As Wikipedia previously had no database, that is where the data was stored.  Altering that content programmatically involves parsing that template as a string.  Its ugly (sorry Jon) and there are more than 11,000 of these templates to maintain (one per gene in Wikipedia).

Now, the same data can be represented in Wikidata, a queriable, open graph of claims about the world backed by references and specified by qualifiers [Vrandečić 2014].  Now that the content needed to render the infobox is all there, we can convert 11,000+ complex templates that require string parsing to maintain to a single, re-usable template for all of them.

The first cut at the new template is {{infobox gene}}.  If you put that on any article about a human gene, you ought to get the complete infobox for the article without any further ado.  Poof!  You can view it in action on this revision for ARF6.  We haven't rolled out the new template across all the articles yet, but hope to see that happen in the coming months.  Remaining issues include: better error-handling in the template code, better ways to give users the ability to edit the associated data in wikidata, and updates to all of the code that produces gene wiki articles.  If you want to help, chime in on the module:wikidata thread.


Saturday, October 8, 2011

Stepping towards a Semantic Wikipedia

(Update, check out our publication in Database for a full-length, peer-reviewed version of this article.)
It is now possible to specify the nature of the relationships between things described by Wikipedia articles directly in the context of the article.  The image below is a screenshot taken a few moments ago of the Phospholamban article on Wikipedia (with excited arrows added).  The infobox at the top right is dynamically generated from semantic markup in the article using a Wikipedia user script written by my colleague Sal and accessible from his user page

Semantic markup now live in Wikipedia

How it works
Wikilinks in the article have been annotated with the kind of relationship that they indicate using the Semantic Wiki Link (SWL) template. The template allows any Wikipedia editor (including you!) to specify the type of connection that exists between the article where the link is being placed and the target of the link. This information is encoded following the microformat pattern. Essentially, we encode the meaning of the links in class attributes that wrap the link.
This works as follows:
  1. Editor inserts a SWL into a Wikipedia article with this syntax:
    • {{SWL | target=protein kinase S | label=PKA | type =substrate_for}}
    • This means "the concept where you see this link is related to protein kinase A (labeled PKA) with the relationship type "substrate for". So, in the example above, it says: "Phospholamban is a substrate for PKA".
    • The {{}} denotes a Wikipedia template. Templates can take parameters (here parameters are separated by |'s) and use them to produce new WikiText dynamically which, in turn, is rendered as HTML when a page is loaded.
  2. When the page is rendered, the template generates the following semi-semantic HTML markup (with some formatting omitted for clarity):

  3. Programs, like the script that generated that infobox and added the green highlighting, can look for the SWL class attribute can then extract the meaning of the SWL links based on the class of its first child element - here "substrate_for".
  4. In addition, when the template is processed it adds a category to the article it is placed on that corresponds to the relationship type. (See for example, the category for substrate.) This category provides a logical grouping (e.g. all things that serve as a biochemical substrate) but, perhaps more importantly, it provides a place to record the meaning of the relationship. This meaning can be defined as text, but can also be defined through reference to external sources such as ontologies on the semantic web.


Why its awesome
This pattern makes it possible for the vast number of Wikipedia users to simply and easily contribute machine readable content to the Web. This enormous user community collaboratively created the world's largest encyclopedia and one of the most valuable websites on the planet. Who better to help build the semantic Web? While, technically, the microformat-like implementation leaves much to be desired in terms of its robustness and its precision, it is a solution that can work. This is demonstrated by the success of projects like Google's recent recipe search that are based entirely on simple microformats.
How you can help
This is a new idea that not everyone in Wikipedia will be thrilled to see. They will claim that the SWLs will clutter the markup and will not provide enough value to make it worth it because Wikipedia itself does not support semantic links. You can help by:
  • Using the template to enhance articles.
  • Writing code that makes use of the added meaning such as user scripts, aggregators, or scripts that import the relationships into other structured repositories like FreeBase or DBpedia.
  • Helping define the nature of the semantic links (at their associated category pages) and mapping them to properties defined in ontologies.
  • Discussing (and voting for) the idea on the various 'talk pages' on Wikipedia.

Why its awesome again
Did I mention that this pattern makes it possible for the vast number of Wikipedia users to simply and easily contribute machine readable content to the Web? Thats pretty cool if you think about it...

Update: To make the user script work for you so you can see the infobox, do this:

  • Create a Wikipedia user account if you don't have one already
  • Go to/create your user page. (e.g. my user name there is i9606 and my user page is located at http://en.wikipedia.org/wiki/User:I9606 )
  • Edit your user page add this to it - 
[[/common.js]]
  • Visit your new common.js add this to it - 
importScript('User:Sal9000/SWLinfobox.js');
  • When that is saved, you should be all set. Now go visit an enhanced page like Phospholamban and look for the green box at the upper right corner.
The script will run whenever you access a Wikipedia page while you are logged in to your account. Its a lot like GreaseMonkey, (which I've had some fun with in the past) but its not tied to your browser and will only work on Wikipedia. If enough people like a user script, it can be added to the default set of Wikipedia user preferences.. which would be pretty cool ;). The best part? You (or a programmer friend of yours) can write your own script and make it do whatever you want with the data!

Thursday, May 27, 2010

Gene Wiki Hairball 1

Here is a view of the hyperlink network in the Gene Wiki.

Generated as follows:

  1. Query Wikipedia for articles in the Protein category (using the API with some help from the Bliki java client library).
  2. Extract links to other Wikipedia articles
  3. Build link network in Cytoscape (organic layout)
Pretty I think, now what do we do with it?

Sunday, May 20, 2007

Linked Data - a new name for RDF..

Aside from the collaborative construction of knowledge workshop that I discussed in my last post, no particular session or presentation from WWW2007 really stands out in my mind. That being said, the various sessions organized under the rather loose term "linked data" seemed to me to offer the most exciting new developments. Whether this was because Tim Berners-Lee was at most of these sessions or whether he was at these sessions because this was where the action was, I can't be sure.

The concept of "linked data" as far as I can tell, is essentially the same as web-based data integration which, IMO, is essentially the applied (non-theoretical/"actually useful") version of the semantic web. The basic ideas (described here) are basically that data should be represented in RDF and should be exposed on the Web such that the URIs can be "linked to" by other RDF statements in a similar way to how HTML pages can be linked to from other pages (but with the additional semantics provided by the RDF language). As I thought this was the basic idea of RDF all along, I'm a little uncertain why the new name came into being - perhaps its just easier to get across to people.

Anyway, the point is that, all of a sudden, there seems to be a whole lot of linked data/resolvable RDF out on the Web (finally!). One of the most exciting academic projects under this umbrella is DBpedia. DBpedia has converted the structured information present in Wikipedia into a resolvable RDF representation. This means that you can query it like a database and you can link to it in the data that you publish in as RDF - enriching both your own content and the semantic web as a whole. Cool.. Another project along similar lines but from the commercial side is called FreeBase.

Within the bioinformatics domain, we will shortly be seeing the public announcement of the new, fully RDFized version of UniProt and we already have an RDF wrapper around a large portion of the world's major bioinformatics databases in the form of Francois Belleau's Bio2RDF.

The semantic web is there - time to start writing those agents and browsers that can actually make use of it!