diff --git a/extensions/rdf-exporter/.classpath b/extensions/rdf-exporter/.classpath
new file mode 100644
index 000000000..fe978b453
--- /dev/null
+++ b/extensions/rdf-exporter/.classpath
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extensions/rdf-exporter/.project b/extensions/rdf-exporter/.project
new file mode 100644
index 000000000..99d97a560
--- /dev/null
+++ b/extensions/rdf-exporter/.project
@@ -0,0 +1,17 @@
+
+
+ rdf-exporter
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/extensions/rdf-exporter/LICENSE.txt b/extensions/rdf-exporter/LICENSE.txt
new file mode 100644
index 000000000..26f1bc56d
--- /dev/null
+++ b/extensions/rdf-exporter/LICENSE.txt
@@ -0,0 +1,28 @@
+/*
+ * External Licenses
+ */
+
+See the 'licenses' directory for a list of the licenses for the libraries we depend on,
+ordered here by license:
+
+Jena 2.6.0
+ (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ http://jena.sourceforge.net/license.html
+
+ARQ, ARQ Extra 2.7.0
+ (c) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ (c) Copyright 2010 Talis Information Ltd
+ All rights reserved.
+ http://jena.sourceforge.net/ARQ/license.html
+
+iri 0.6
+ (c) Copyright 2007 Hewlett-Packard Development Company, LP
+ http://jena.sourceforge.net/iri/license.html
+
+Lucene 3.0.1
+ Apache License
+ http://www.apache.org/licenses/LICENSE-2.0.html
+
+xercesImpl 2.7.1
+ Apache License
+ http://www.apache.org/licenses/LICENSE-2.0.html
diff --git a/extensions/rdf-exporter/build.xml b/extensions/rdf-exporter/build.xml
new file mode 100644
index 000000000..c4aef7da2
--- /dev/null
+++ b/extensions/rdf-exporter/build.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extensions/rdf-exporter/licenses/arq.LICENSE.txt b/extensions/rdf-exporter/licenses/arq.LICENSE.txt
new file mode 100644
index 000000000..85a3c7cce
--- /dev/null
+++ b/extensions/rdf-exporter/licenses/arq.LICENSE.txt
@@ -0,0 +1,29 @@
+ARQ 2.7.0
+
+http://jena.sourceforge.net/ARQ/license.html
+
+(c) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+(c) Copyright 2010 Talis Information Ltd
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/extensions/rdf-exporter/licenses/iri.LICENSE.txt b/extensions/rdf-exporter/licenses/iri.LICENSE.txt
new file mode 100644
index 000000000..93b2900d7
--- /dev/null
+++ b/extensions/rdf-exporter/licenses/iri.LICENSE.txt
@@ -0,0 +1,30 @@
+iri 0.6
+http://jena.sourceforge.net/iri/license.html
+
+Copyright 2007 Hewlett-Packard Development Company, LP
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+The name of the author may not be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/extensions/rdf-exporter/licenses/jena.LICENSE.txt b/extensions/rdf-exporter/licenses/jena.LICENSE.txt
new file mode 100644
index 000000000..07cca6a16
--- /dev/null
+++ b/extensions/rdf-exporter/licenses/jena.LICENSE.txt
@@ -0,0 +1,29 @@
+Jena 2.6.0
+http://jena.sourceforge.net/license.html
+
+(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+The name of the author may not be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/extensions/rdf-exporter/module/MOD-INF/controller.js b/extensions/rdf-exporter/module/MOD-INF/controller.js
new file mode 100755
index 000000000..c2450f251
--- /dev/null
+++ b/extensions/rdf-exporter/module/MOD-INF/controller.js
@@ -0,0 +1,77 @@
+
+importPackage(com.metaweb.gridworks.rdf.commands);
+
+/*
+ * Function invoked to initialize the extension.
+ */
+function init() {
+ /*
+ * Attach an rdf schema to each project.
+ */
+ Packages.com.metaweb.gridworks.model.Project.registerOverlayModel(
+ "rdfSchema",
+ Packages.com.metaweb.gridworks.rdf.RdfSchema);
+
+ /*
+ * Operations
+ */
+ Packages.com.metaweb.gridworks.operations.OperationRegistry.register(
+ "save-rdf-schema", Packages.com.metaweb.gridworks.rdf.operations.SaveRdfSchemaOperation);
+
+ /*
+ * Exporters
+ */
+ var ExportRowsCommand = Packages.com.metaweb.gridworks.commands.project.ExportRowsCommand;
+ var RdfExporter = Packages.com.metaweb.gridworks.rdf.exporters.RdfExporter;
+
+ ExportRowsCommand.registerExporter("rdf", new RdfExporter("RDF/XML"));
+ ExportRowsCommand.registerExporter("n3", new RdfExporter("N3"));
+
+ /*
+ * GEL Functions and Binders
+ */
+ Packages.com.metaweb.gridworks.gel.ControlFunctionRegistry.registerFunction(
+ "urlify", new Packages.com.metaweb.gridworks.rdf.expr.functions.strings.Urlify());
+
+ Packages.com.metaweb.gridworks.expr.ExpressionUtils.registerBinder(
+ new Packages.com.metaweb.gridworks.rdf.expr.RdfBinder());
+
+ /*
+ * Commands
+ */
+ var GridworksServlet = Packages.com.metaweb.gridworks.GridworksServlet;
+ GridworksServlet.registerCommand("save-rdf-schema", new SaveRdfSchemaCommand());
+ GridworksServlet.registerCommand("preview-rdf",new PreviewRdfCommand());
+ GridworksServlet.registerCommand("save-baseURI",new SaveBaseURI());
+ GridworksServlet.registerCommand("suggest-term",new SuggestTermCommand());
+ GridworksServlet.registerCommand("import-vocabulary",new ImportVocabularyCommand());
+ GridworksServlet.registerCommand("list-vocabularies",new ListVocabulariesCommand());
+ GridworksServlet.registerCommand("delete-vocabulary",new DeleteVocabularyCommand());
+
+ /*
+ * Client-side Resources
+ */
+ var ClientSideResourceManager = Packages.com.metaweb.gridworks.ClientSideResourceManager;
+
+ // Script files to inject into /project page
+ ClientSideResourceManager.addPaths(
+ "project/scripts",
+ module,
+ [
+ "scripts/menu-bar-extensions.js",
+ "scripts/rdf-schema-alignment.js",
+ "scripts/rdf-schema-alignment-ui-node.js",
+ "scripts/rdf-schema-alignment-ui-link.js",
+ "scripts/suggestterm.suggest.js"
+ ]
+ );
+
+ // Style files to inject into /project page
+ ClientSideResourceManager.addPaths(
+ "project/styles",
+ module,
+ [
+ "styles/rdf-schema-alignment-dialog.css",
+ ]
+ );
+}
diff --git a/extensions/rdf-exporter/module/MOD-INF/lib/arq-2.7.0.jar b/extensions/rdf-exporter/module/MOD-INF/lib/arq-2.7.0.jar
new file mode 100755
index 000000000..90c458c4b
Binary files /dev/null and b/extensions/rdf-exporter/module/MOD-INF/lib/arq-2.7.0.jar differ
diff --git a/extensions/rdf-exporter/module/MOD-INF/lib/arq-extra-2.7.0.jar b/extensions/rdf-exporter/module/MOD-INF/lib/arq-extra-2.7.0.jar
new file mode 100755
index 000000000..72cb9c7d6
Binary files /dev/null and b/extensions/rdf-exporter/module/MOD-INF/lib/arq-extra-2.7.0.jar differ
diff --git a/extensions/rdf-exporter/module/MOD-INF/lib/iri-0.6.jar b/extensions/rdf-exporter/module/MOD-INF/lib/iri-0.6.jar
new file mode 100755
index 000000000..b2026e455
Binary files /dev/null and b/extensions/rdf-exporter/module/MOD-INF/lib/iri-0.6.jar differ
diff --git a/extensions/rdf-exporter/module/MOD-INF/lib/jena-2.6.0.jar b/extensions/rdf-exporter/module/MOD-INF/lib/jena-2.6.0.jar
new file mode 100755
index 000000000..6a532bd43
Binary files /dev/null and b/extensions/rdf-exporter/module/MOD-INF/lib/jena-2.6.0.jar differ
diff --git a/extensions/rdf-exporter/module/MOD-INF/lib/lucene-core-3.0.1.jar b/extensions/rdf-exporter/module/MOD-INF/lib/lucene-core-3.0.1.jar
new file mode 100755
index 000000000..411524695
Binary files /dev/null and b/extensions/rdf-exporter/module/MOD-INF/lib/lucene-core-3.0.1.jar differ
diff --git a/extensions/rdf-exporter/module/MOD-INF/lib/xercesImpl-2.7.1.jar b/extensions/rdf-exporter/module/MOD-INF/lib/xercesImpl-2.7.1.jar
new file mode 100755
index 000000000..eac75ae8e
Binary files /dev/null and b/extensions/rdf-exporter/module/MOD-INF/lib/xercesImpl-2.7.1.jar differ
diff --git a/extensions/rdf-exporter/module/MOD-INF/module.properties b/extensions/rdf-exporter/module/MOD-INF/module.properties
new file mode 100755
index 000000000..8a8308772
--- /dev/null
+++ b/extensions/rdf-exporter/module/MOD-INF/module.properties
@@ -0,0 +1,4 @@
+name = rdf-exporter
+description = Freebase Gridworks RDF export
+templating = false
+requires = core
\ No newline at end of file
diff --git a/extensions/rdf-exporter/module/scripts/menu-bar-extensions.js b/extensions/rdf-exporter/module/scripts/menu-bar-extensions.js
new file mode 100644
index 000000000..b487965a1
--- /dev/null
+++ b/extensions/rdf-exporter/module/scripts/menu-bar-extensions.js
@@ -0,0 +1,76 @@
+MenuBar.insertBefore(
+ [ "core/project", "core/export", "core/export-templating" ],
+ [
+ {
+ "label":"RDF as RDF/XML",
+ "click": function() { RdfExporterMenuBar.exportRDF("rdf", "rdf"); }
+ },
+ {
+ "label":"RDF as Turtle",
+ "click": function() { RdfExporterMenuBar.exportRDF("n3", "ttl"); }
+ },
+ {}
+ ]
+);
+
+MenuBar.insertBefore(
+ [ "core/schemas", "core/load-info-freebase" ],
+ [
+ {
+ label: "Edit RDF Schema...",
+ click: function() { RdfExporterMenuBar.editRdfSchema(false); }
+ },
+ {
+ label: "Reset RDF Schema...",
+ click: function() { RdfExporterMenuBar.editRdfSchema(true); }
+ },
+ {}
+ ]
+);
+
+RdfExporterMenuBar = {};
+
+RdfExporterMenuBar.exportRDF = function(format, ext) {
+ if (!theProject.overlayModels.rdfSchema) {
+ alert(
+ "You haven't done any RDF schema alignment yet!"
+ );
+ } else {
+ RdfExporterMenuBar.rdfExportRows(format, ext);
+ }
+};
+
+RdfExporterMenuBar.rdfExportRows = function(format, ext) {
+ var name = $.trim(theProject.metadata.name.replace(/\W/g, ' ')).replace(/\s+/g, '-');
+ var form = document.createElement("form");
+ $(form)
+ .css("display", "none")
+ .attr("method", "post")
+ .attr("action", "/command/export-rows/" + name + "." + ext)
+ .attr("target", "gridworks-export");
+
+ $('')
+ .attr("name", "engine")
+ .attr("value", JSON.stringify(ui.browsingEngine.getJSON()))
+ .appendTo(form);
+ $('')
+ .attr("name", "project")
+ .attr("value", theProject.id)
+ .appendTo(form);
+ $('')
+ .attr("name", "format")
+ .attr("value", format)
+ .appendTo(form);
+
+ document.body.appendChild(form);
+
+ window.open("about:blank", "gridworks-export");
+ form.submit();
+
+ document.body.removeChild(form);
+};
+
+RdfExporterMenuBar.editRdfSchema = function(reset) {
+ new RdfSchemaAlignmentDialog(reset ? null : theProject.overlayModels.rdfSchema);
+};
+
diff --git a/extensions/rdf-exporter/module/scripts/rdf-schema-alignment-ui-link.js b/extensions/rdf-exporter/module/scripts/rdf-schema-alignment-ui-link.js
new file mode 100755
index 000000000..07b902601
--- /dev/null
+++ b/extensions/rdf-exporter/module/scripts/rdf-schema-alignment-ui-link.js
@@ -0,0 +1,135 @@
+RdfSchemaAlignmentDialog.UILink = function(dialog, link, table, options, parentUINode) {
+ this._dialog = dialog;
+ this._link = link;
+ this._options = options;
+ this._parentUINode = parentUINode;
+
+ // Make sure target node is there
+ this._link.target = this._link.target || { nodeType: "cell-as-literal" }
+
+ this._tr = table.insertRow(table.rows.length);
+ this._tdMain = this._tr.insertCell(0);
+ this._tdToggle = this._tr.insertCell(1);
+ this._tdDetails = this._tr.insertCell(2);
+
+ $(this._tdMain).addClass("schema-alignment-link-main").attr("width", "250").addClass("padded");
+ $(this._tdToggle).addClass("schema-alignment-link-toggle").attr("width", "1%").addClass("padded");
+ $(this._tdDetails).addClass("schema-alignment-link-details").attr("width", "90%");
+
+ this._collapsedDetailDiv = $('