Design and Implementation of the Sweble Wikitext Parser: Unlocking the Structured Data of Wikipedia

Abstract: The heart of each wiki, including Wikipedia, is its content. Most machine processing starts and ends with this content. At present, such processing is limited, because most wiki engines today cannot provide a complete and precise representation of the wiki’s content. They can only generate HTML. The main reason is the lack of well-defined parsers that can handle the complexity of modern wiki markup. This applies to MediaWiki, the software running Wikipedia, and most other wiki engines. This paper shows why it has been so difficult to develop comprehensive parsers for wiki markup. It presents the design and implementation of a parser for Wikitext, the wiki markup language of MediaWiki. We use parsing expression grammars where most parsers used no grammars or grammars poorly suited to the task. Using this parser it is possible to directly and precisely query the structured data within wikis, including Wikipedia. The parser is available as open source from http://sweble.org.

Keywords: Wiki, Wikipedia, Wiki Parser, Wikitext Parser, Parsing Expression Grammar, PEG, Abstract Syntax Tree, AST, WYSIWYG, Sweble.

Reference: Hannes Dohrn and Dirk Riehle. “Design and Implementation of the Sweble Wikitext Parser: Unlocking the Structured Data of Wikipedia.” In Proceedings of the 7th International Symposium on Wikis and Open Collaboration (WikiSym 2011). ACM Press, 2011.

The paper is available as a PDF file (preprint).

Technical Report on WOM: An Object Model for Wikitext

Abstract: Wikipedia is a rich encyclopedia that is not only of great use to its contributors and readers but also to researchers and providers of third party software around Wikipedia. However, Wikipedia’s content is only available as Wikitext, the markup language in which articles on Wikipedia are written, and whoever needs to access the content of an article has to implement their own parser or has to use one of the available parser solutions. Unfortunately, those parsers which convert Wikitext into a high-level representation like an abstract syntax tree (AST) define their own format for storing and providing access to this data structure. Further, the semantics of Wikitext are only defined implicitly in the MediaWiki software itself. This situation makes it difficult to reason about the semantic content of an article or exchange and modify articles in a standardized and machine-accessible way. To remedy this situation we propose a markup language, called XWML, in which articles can be stored and an object model, called WOM, that defines how the contents of an article can be read and modified.

Keywords: Wiki, Wikipedia, Wikitext, Wikitext Parser, Open Source, Sweble, Mediawiki, Mediawiki Parser, XWML, HTML, WOM

Reference: Hannes Dohrn and Dirk Riehle. WOM: An Object Model for Wikitext. University of Erlangen, Technical Report CS-2011-05 (July 2011).

The technical report is available as a PDF file.

On the Open Cloud Principles: Every Real-World Specification is an Underspecification

Trying to wrap my head around the Open Cloud Principles put out by the revamp of the Open Cloud Initiative, I’m happy to note that software engineering research has something to say to the challenges these principles will face.

Every real-world specification is an underspecification.

So, well, I say that, but I doubt that I’m the first one to have learned this from 30+ years of software engineering research. This principle leads us directly to the challenges anyone is facing who is trying to be truthful to the intentions behind the Open Cloud Principles.

Continue reading

The Evolution of the Source Forge Home Page

I was revising my talk on “Inner Source” when it occurred to me that it might be fun to review the changes to the sf.net (Sourceforge) homepage. Please find my collection of screenshots below. I only started saving them in 2007 so pointers to more and older screenshots are welcome! (In particular if they come with a CC license so that I can use them in talks, attribution is a given. I trust that Geek.net does not object…) Thanks!

Continue reading

The Java IP Story

Every year, I teach the AMOS class, a lab course on “Agile Methods and Open Source” that combines lectures with a real software project that ideally turns into a startup (see the AMOS Project concept, in German). To explain open source, I have to introduce students to intellectual property rights, of which most have been blissfully unaware of until then. Nothing teaches concepts better than a colorful story, and so I have been using the IP strategies around Java to make this dry topic come alive. For fun, comments, and corrections, I’m providing the short version of my talk below, including commentary. (You can also download a PDF version of the talk, licensed as CC-BY 3.0. If you find this useful for teaching, please tell me.) Students at this point have a basic working understanding of intellectual property and exclusion rights. Please let me know what you think! Finally, IANAL.

Java is an important technology powering the modern web and in particular enterprise applications. It has a checkered intellectual property history, and with the recent acquisition of Sun, the Java creator and owner, by Oracle, things only stand to heat up. This slide set discusses some of the more interesting issues around Java intellectual property and its strategic use in business.

  1. What is Java?
  2. Short Java IP Story Time-Line
  3. Three Substories
  4. Java’s Challenge to the Windows Platform
  5. Microsoft and Java
  6. The OpenJDK Strategy (Open Core Model)
  7. Certification of Compatible Implementations
  8. Threats to Commercial Revenue
  9. Main Tools to Curtail “Competitors”
  10. Problems for Alternative Implementations
  11. Problems for OpenJDK Forks
  12. Thank you! and References

Continue reading

Call for Papers: SoSyM Special Issue on Enterprise Modeling

Call for Papers as PDF

Modern organizations rely on complex configurations of distributed IT systems that implement key business processes, provide databases, data warehousing, and business intelligence. The current business environment requires organizations to comply with a range of externally defined regulations such as Sarbanes-Oxley and BASEL II.

Organizations need to be increasingly agile, robust, and be able to react to complex events, possibly in terms of dynamic reconfiguration.

Continue reading

The Open Source Big Bang

Open source is not only software, but also an approach to software development. The public nature of open source projects lets us show how open source software development scales to the largest project sizes. The following figure illustrates the scalability of open source software development. I call it the big bang of open source.

Continue reading

More Upcoming Talks: Open Source Research

I’ll be presenting the Open Source Research talk repeatedly over the next few months. The next three instances are in China, specifically:

  • Tsinghua University on March 17th, 2011
  • Peking University on March 18th, 2011
  • University of Macau on April 1st, 2011

After that it’s back to Germany.

Why I'm Interested In Computer Games Research

Just before my inaugural lecture at University of Erlangen, a broad panel of scientists was debating the merits of computer games. Except for a computer games researcher and a games professional, all participants thought that computer games are of no particular interest. When I asked: “But isn’t there anything to learn from computer games?” I got a full rebuke by the M.D. on the panel: “No, there is no recognizable value whatsoever.”

Continue reading