YAGO2s Converters These are the converter tools of the YAGO2s knowledge base. They are published by the YAGO team at the Max Planck Institute for Informatics under a Creative Commons Attribution 3.0 License (http://creativecommons.org/licenses/by/3.0/). See http://yago-knowledge.org for all further information. This file explains * what you need to work with YAGO * what the file formats are * how to load YAGO into a database * how to query YAGO in SPARQL * how to produce SVG images from YAGO ============= What you need =============== To work with YAGO, you first have to download the YAGO knowledge base. You can download the entire ontology or any subset of themes. See http://yago-knowledge.org for all information. You also need the Java runtime environment. To compile the files, you need the Java Development Kit (JDK) in its 1.7 version. See http://jdk7.java.net/ for all details. ============= File Formats =============== ---------- Turtle The YAGO knowledge base is a set of independent modular full-text files. These files are in the N3 Turtle format, ending in *.ttl. See http://www.w3.org/TeamSubmission/turtle/ for details on this format. ---------- N4 YAGO extends the Turtle format to the "N4 format". In this format, every triple can have an identifier, the fact identifier. The fact identifier is specified as a comment in the line before the triple. As a result, all N4 files are fully backwards compatible with standard Turtle and N3. The fact identifier can appear as a subject in other triples. This is used to annotate YAGO facts with time and space. ---------- Identifiers All identifiers in YAGO are standard Turtle identifiers. There are a number of prefixes predefined, such as rdf, rdfs, owl, etc. The base is set to http://yago-knowledge.org/resource/ YAGO defines its own datatypes, which extend the standard datatypes. Examples: * Entities are written in <> : * Strings are written in double quotes, with optional language tags: "Elvis", "Elvis"@en * Literals are written in double quotes with a datatype: "1977-08-16"^^xsd:date ============= YAGO in a Database =============== To load YAGO into a database, and to query it in SQL, follow these steps: ------- Convert YAGO to TSV Convert the YAGO N4 files to TSV (Tab separated values). For this purpose, use TsvConverter. You can also download the TSV files directly from the YAGO homepage http://yago-knowledge.org ------- Load YAGO into a database For this purpose, you need * a database installation (such as Postgres, MySQL, or Oracle) * YAGO in TSV format (see above) Most database systems can load TSV files directly. For Postgres, we provide a script in scripts/Postgres.sh ------- Query YAGO in SQL All facts of YAGO are in a single database table, called yagoFacts(id, subject, predicate, object) You can fire SQL queries such as SELECT relation, object FROM yagoFacts WHERE subject='' ============= YAGO and SPARQL =============== To query YAGO in SPARQL, follow these steps. SPARQL does not support the fact identifiers of YAGO's N4 format.\ This means that meta-facts, including provenance, time and space information, cannot be queried in SPARQL. -------- Load YAGO into a Jena database YAGO can be loaded into a Jena database. For this purpose, the YAGO converters package contains the Jena ontology framework. We are very grateful that we may use the Jena framework. For all further information on the project, see http://sourceforge.net/projects/jena/ To load YAGO into a Jena database, use JenaConverter. Jena does not support the fact identifiers of YAGO's N4 format. This means that all meta-facts, including provenance, time and space information, are lost in this version of YAGO. -------- Query YAGO in SPARQL Use SparqlEngine to fire SPARQL queries. Example: SELECT ?r ?y WHERE { ?r ?y . } This engine can also be used programmatically. ============= YAGO and SVG =============== SVG is the vector graphics format approved by the W3C. For all further information, see http://www.w3.org/Graphics/SVG/ We provide a tool that can produce an SVG image of all facts centered around a given entity. To produce an image, use SvgMaker .