You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/23 11:35:38 UTC

[23/58] [abbrv] incubator-taverna-plugin-component git commit: taverna-component-repository -> taverna-component-repository-api

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/catalog/xml.xsd
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/catalog/xml.xsd b/taverna-component-repository-api/src/main/catalog/xml.xsd
new file mode 100644
index 0000000..aea7d0d
--- /dev/null
+++ b/taverna-component-repository-api/src/main/catalog/xml.xsd
@@ -0,0 +1,287 @@
+<?xml version='1.0'?>
+<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns   ="http://www.w3.org/1999/xhtml"
+  xml:lang="en">
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+    <h1>About the XML namespace</h1>
+
+    <div class="bodytext">
+     <p>
+      This schema document describes the XML namespace, in a form
+      suitable for import by other schema documents.
+     </p>
+     <p>
+      See <a href="http://www.w3.org/XML/1998/namespace.html">
+      http://www.w3.org/XML/1998/namespace.html</a> and
+      <a href="http://www.w3.org/TR/REC-xml">
+      http://www.w3.org/TR/REC-xml</a> for information 
+      about this namespace.
+     </p>
+     <p>
+      Note that local names in this namespace are intended to be
+      defined only by the World Wide Web Consortium or its subgroups.
+      The names currently defined in this namespace are listed below.
+      They should not be used with conflicting semantics by any Working
+      Group, specification, or document instance.
+     </p>
+     <p>   
+      See further below in this document for more information about <a
+      href="#usage">how to refer to this schema document from your own
+      XSD schema documents</a> and about <a href="#nsversioning">the
+      namespace-versioning policy governing this schema document</a>.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>lang (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       is a language code for the natural language of the content of
+       any element; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML specification.</p>
+     
+    </div>
+    <div>
+     <h4>Notes</h4>
+     <p>
+      Attempting to install the relevant ISO 2- and 3-letter
+      codes as the enumerated possible values is probably never
+      going to be a realistic possibility.  
+     </p>
+     <p>
+      See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
+       http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
+      and the IANA language subtag registry at
+      <a href="http://www.iana.org/assignments/language-subtag-registry">
+       http://www.iana.org/assignments/language-subtag-registry</a>
+      for further information.
+     </p>
+     <p>
+      The union allows for the 'un-declaration' of xml:lang with
+      the empty string.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:union memberTypes="xs:language">
+    <xs:simpleType>    
+     <xs:restriction base="xs:string">
+      <xs:enumeration value=""/>
+     </xs:restriction>
+    </xs:simpleType>
+   </xs:union>
+  </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>space (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose
+       value is a keyword indicating what whitespace processing
+       discipline is intended for the content of the element; its
+       value is inherited.  This name is reserved by virtue of its
+       definition in the XML specification.</p>
+     
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:restriction base="xs:NCName">
+    <xs:enumeration value="default"/>
+    <xs:enumeration value="preserve"/>
+   </xs:restriction>
+  </xs:simpleType>
+ </xs:attribute>
+ 
+ <xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>base (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       provides a URI to be used as the base for interpreting any
+       relative URIs in the scope of the element on which it
+       appears; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML Base specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+ 
+ <xs:attribute name="id" type="xs:ID">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>id (as an attribute name)</h3> 
+      <p>
+       denotes an attribute whose value
+       should be interpreted as if declared to be of type ID.
+       This name is reserved by virtue of its definition in the
+       xml:id specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+  <xs:attribute ref="xml:base"/>
+  <xs:attribute ref="xml:lang"/>
+  <xs:attribute ref="xml:space"/>
+  <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+   
+    <h3>Father (in any context at all)</h3> 
+
+    <div class="bodytext">
+     <p>
+      denotes Jon Bosak, the chair of 
+      the original XML Working Group.  This name is reserved by 
+      the following decision of the W3C XML Plenary and 
+      XML Coordination groups:
+     </p>
+     <blockquote>
+       <p>
+	In appreciation for his vision, leadership and
+	dedication the W3C XML Plenary on this 10th day of
+	February, 2000, reserves for Jon Bosak in perpetuity
+	the XML name "xml:Father".
+       </p>
+     </blockquote>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div xml:id="usage" id="usage">
+    <h2><a name="usage">About this schema document</a></h2>
+
+    <div class="bodytext">
+     <p>
+      This schema defines attributes and an attribute group suitable
+      for use by schemas wishing to allow <code>xml:base</code>,
+      <code>xml:lang</code>, <code>xml:space</code> or
+      <code>xml:id</code> attributes on elements they define.
+     </p>
+     <p>
+      To enable this, such a schema must import this schema for
+      the XML namespace, e.g. as follows:
+     </p>
+     <pre>
+          &lt;schema . . .>
+           . . .
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     </pre>
+     <p>
+      or
+     </p>
+     <pre>
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     </pre>
+     <p>
+      Subsequently, qualified reference to any of the attributes or the
+      group defined below will have the desired effect, e.g.
+     </p>
+     <pre>
+          &lt;type . . .>
+           . . .
+           &lt;attributeGroup ref="xml:specialAttrs"/>
+     </pre>
+     <p>
+      will define a type which will schema-validate an instance element
+      with any of those attributes.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div id="nsversioning" xml:id="nsversioning">
+    <h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
+    <div class="bodytext">
+     <p>
+      In keeping with the XML Schema WG's standard versioning
+      policy, this schema document will persist at
+      <a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd</a>.
+     </p>
+     <p>
+      At the date of issue it can also be found at
+      <a href="http://www.w3.org/2001/xml.xsd">
+       http://www.w3.org/2001/xml.xsd</a>.
+     </p>
+     <p>
+      The schema document at that URI may however change in the future,
+      in order to remain compatible with the latest version of XML
+      Schema itself, or with the XML namespace itself.  In other words,
+      if the XML Schema or XML namespaces change, the version of this
+      document at <a href="http://www.w3.org/2001/xml.xsd">
+       http://www.w3.org/2001/xml.xsd 
+      </a> 
+      will change accordingly; the version at 
+      <a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd 
+      </a> 
+      will not change.
+     </p>
+     <p>
+      Previous dated (and unchanging) versions of this schema 
+      document are at:
+     </p>
+     <ul>
+      <li><a href="http://www.w3.org/2009/01/xml.xsd">
+	http://www.w3.org/2009/01/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2007/08/xml.xsd">
+	http://www.w3.org/2007/08/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2004/10/xml.xsd">
+	http://www.w3.org/2004/10/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2001/03/xml.xsd">
+	http://www.w3.org/2001/03/xml.xsd</a></li>
+     </ul>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+</xs:schema>
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Component.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Component.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Component.java
new file mode 100644
index 0000000..47bc7e9
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Component.java
@@ -0,0 +1,71 @@
+package net.sf.taverna.t2.component.api;
+
+import java.net.URL;
+import java.util.SortedMap;
+
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+/**
+ * The abstract interface supported by a component.
+ * 
+ * @author Donal Fellows
+ * @author David Withers
+ */
+public interface Component extends NamedItem {
+	/**
+	 * @return the name of the Component.
+	 */
+	@Override
+	String getName();
+
+	/**
+	 * Returns the URL for the Component.
+	 * 
+	 * @return the URL for the Component.
+	 */
+	URL getComponentURL();
+
+	/**
+	 * Creates a new version of this Component.
+	 * 
+	 * @param bundle
+	 *            the workflow that the new ComponentVersion will use.
+	 * @return a new version of this Component.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	Version addVersionBasedOn(WorkflowBundle bundle, String revisionComment)
+			throws ComponentException;
+
+	/**
+	 * Returns the ComponentVersion that has the specified version number.
+	 * 
+	 * @param version
+	 *            the version number of the ComponentVersion to return.
+	 * @return the ComponentVersion that has the specified version number.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	Version getComponentVersion(Integer version) throws ComponentException;
+
+	/**
+	 * @return the description of the Component.
+	 */
+	@Override
+	String getDescription();
+
+	/**
+	 * Returns a SortedMap of version number to ComponentVersion.
+	 * <p>
+	 * The returned map is sorted increasing numeric order.
+	 * 
+	 * @return a SortedMap of version number to ComponentVersion.
+	 */
+	SortedMap<Integer, Version> getComponentVersionMap();
+
+	Registry getRegistry();
+
+	Family getFamily();
+
+	void delete() throws ComponentException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentException.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentException.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentException.java
new file mode 100644
index 0000000..2b5d829
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentException.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.component.api;
+
+/**
+ * Thrown when there is a problem interacting with a ComponentRegistry.
+ *
+ * @author David Withers
+ */
+public class ComponentException extends Exception {
+	private static final long serialVersionUID = -5222074350812438467L;
+
+	public ComponentException() {
+		super();
+	}
+
+	public ComponentException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public ComponentException(String message) {
+		super(message);
+	}
+
+	public ComponentException(Throwable cause) {
+		super(cause);
+	}
+
+	public ComponentException(String messageTemplate, Object...parameters) {
+		super(String.format(messageTemplate, parameters));
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentFactory.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentFactory.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentFactory.java
new file mode 100644
index 0000000..8c7d533
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentFactory.java
@@ -0,0 +1,27 @@
+package net.sf.taverna.t2.component.api;
+
+import java.net.URL;
+
+import net.sf.taverna.t2.component.api.profile.Profile;
+
+public interface ComponentFactory {
+	public Registry getRegistry(URL registryBase) throws ComponentException;
+
+	public Family getFamily(URL registryBase, String familyName)
+			throws ComponentException;
+
+	public Component getComponent(URL registryBase, String familyName,
+			String componentName) throws ComponentException;
+
+	public Version getVersion(URL registryBase, String familyName,
+			String componentName, Integer componentVersion)
+			throws ComponentException;
+
+	public Version getVersion(Version.ID ident) throws ComponentException;
+
+	public Component getComponent(Version.ID ident) throws ComponentException;
+
+	public Profile getProfile(URL url) throws ComponentException;
+
+	public Profile getBaseProfile() throws ComponentException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Family.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Family.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Family.java
new file mode 100644
index 0000000..f618af7
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Family.java
@@ -0,0 +1,99 @@
+package net.sf.taverna.t2.component.api;
+
+import java.util.List;
+
+import net.sf.taverna.t2.component.api.profile.Profile;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+public interface Family extends NamedItem {
+	/**
+	 * Creates a new Component and adds it to this ComponentFamily.
+	 * 
+	 * @param componentName
+	 *            the name of the Component to create. Must not be null.
+	 * @param bundle
+	 *            the workflow for the Component. Must not be null.
+	 * @return the new Component.
+	 * @throws ComponentException
+	 *             <ul>
+	 *             <li>if componentName is null,
+	 *             <li>if dataflow is null,
+	 *             <li>if a Component with this name already exists,
+	 *             <li>if there is a problem accessing the ComponentRegistry.
+	 *             </ul>
+	 */
+	Version createComponentBasedOn(String componentName, String description,
+			WorkflowBundle bundle) throws ComponentException;
+
+	/**
+	 * Returns the Component with the specified name.
+	 * <p>
+	 * If this ComponentFamily does not contain a Component with the specified
+	 * name <code>null</code> is returned.
+	 * 
+	 * @param componentName
+	 *            the name of the Component to return. Must not be null.
+	 * @return the Component with the specified name.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	Component getComponent(String componentName) throws ComponentException;
+
+	/**
+	 * Removes the specified Component from this ComponentFamily.
+	 * <p>
+	 * If this ComponentFamily does not contain the Component this method has no
+	 * effect.
+	 * 
+	 * @param component
+	 *            the Component to remove.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	void removeComponent(Component component) throws ComponentException;
+
+	/**
+	 * Returns all the Components in this ComponentFamily.
+	 * <p>
+	 * If this ComponentFamily does not contain any Components an empty list is
+	 * returned.
+	 * 
+	 * @return all the Components in this ComponentFamilies.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	List<Component> getComponents() throws ComponentException;
+
+	/**
+	 * Returns the ComponentProfile for this ComponentFamily.
+	 * 
+	 * @return the ComponentProfile for this ComponentFamily.
+	 * @throws ComponentException
+	 */
+	Profile getComponentProfile() throws ComponentException;
+
+	/**
+	 * Returns the ComponentRegistry that contains this ComponentFamily.
+	 * 
+	 * @return the ComponentRegistry that contains this ComponentFamily.
+	 */
+	Registry getComponentRegistry();
+
+	/**
+	 * @return the name of the component Family.
+	 */
+	@Override
+	String getName();
+
+	/**
+	 * @return the description of the component Family.
+	 */
+	@Override
+	String getDescription();
+
+	/**
+	 * Delete this family from its registry.
+	 * @throws ComponentException
+	 */
+	void delete() throws ComponentException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/License.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/License.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/License.java
new file mode 100644
index 0000000..7e7594d
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/License.java
@@ -0,0 +1,12 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.component.api;
+
+/**
+ * @author alson
+ *
+ */
+public interface License extends NamedItem {
+	public String getAbbreviation();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/NamedItem.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/NamedItem.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/NamedItem.java
new file mode 100644
index 0000000..a31ad4d
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/NamedItem.java
@@ -0,0 +1,8 @@
+package net.sf.taverna.t2.component.api;
+
+public interface NamedItem {
+	/** Name this entity. */
+	public String getName();
+	/** Describe this entity. */
+	public String getDescription();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Registry.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Registry.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Registry.java
new file mode 100644
index 0000000..f7b5be4
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Registry.java
@@ -0,0 +1,139 @@
+package net.sf.taverna.t2.component.api;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Set;
+
+import net.sf.taverna.t2.component.api.profile.Profile;
+
+public interface Registry {
+
+	License getPreferredLicense() throws ComponentException;
+
+	Set<Version.ID> searchForComponents(String prefixString, String text)
+			throws ComponentException;
+
+	/**
+	 * Returns all the ComponentFamilies in this ComponetRegistry.
+	 * <p>
+	 * If this ComponentRegistry does not contain any ComponentFamilies an empty
+	 * list is returned.
+	 * 
+	 * @return all the ComponentFamilies in this ComponetRegistry.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	List<Family> getComponentFamilies() throws ComponentException;
+
+	List<License> getLicenses() throws ComponentException;
+
+	List<SharingPolicy> getPermissions() throws ComponentException;
+
+	/**
+	 * Adds a ComponentProfile to this ComponentRegistry.
+	 * 
+	 * @param componentProfile
+	 *            the ComponentProfile to add. Must not be null.
+	 * @param sharingPolicy
+	 * @param license
+	 * @return the ComponentProfile added to this ComponentRegistry.
+	 * @throws ComponentException
+	 *             <ul>
+	 *             <li>if componentProfile is null,
+	 *             <li>if there is a problem accessing the ComponentRegistry.
+	 *             </ul>
+	 */
+	Profile addComponentProfile(Profile componentProfile, License license,
+			SharingPolicy sharingPolicy) throws ComponentException;
+
+	/**
+	 * Returns all the ComponentProfiles in this ComponetRegistry.
+	 * <p>
+	 * If this ComponentRegistry does not contain any ComponentProfiles an empty
+	 * list is returned.
+	 * 
+	 * @return all the ComponentProfiles in this ComponetRegistry.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	List<Profile> getComponentProfiles() throws ComponentException;
+
+	/**
+	 * Returns the ComponentProfile with the given ID in this ComponetRegistry.
+	 * <p>
+	 * If this ComponentRegistry does not contain the ComponentProfile, a
+	 * <tt>null</tt> is returned.
+	 * 
+	 * @return the matching ComponentProfile in this ComponetRegistry, or
+	 *         <tt>null</tt> if there is no such thing.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	Profile getComponentProfile(String id) throws ComponentException;
+
+	String getRegistryBaseString();
+
+	/**
+	 * Returns the location of this ComponentRepository.
+	 * 
+	 * @return the location of this ComponentRepository
+	 */
+	URL getRegistryBase();
+
+	/**
+	 * Removes a the ComponentFamily with the specified name from this
+	 * ComponentRegistry.
+	 * <p>
+	 * If this ComponentRegistry does not contain a ComponentFamily with the
+	 * specified name this method has no effect.
+	 * 
+	 * @param componentFamily
+	 *            the ComponentFamily to remove.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	void removeComponentFamily(Family componentFamily) throws ComponentException;
+
+	/**
+	 * Creates a new ComponentFamily and adds it to this ComponentRegistry.
+	 * 
+	 * @param familyName
+	 *            the name of the ComponentFamily to create. Must not be null.
+	 * @param componentProfile
+	 *            the ComponentProfile for the new ComponentFamily. Must not be
+	 *            null.
+	 * @param sharingPolicy
+	 *            the SharingPolicy to use for the new ComponentFamily.
+	 * @return the new ComponentFamily
+	 * @throws ComponentException
+	 *             <ul>
+	 *             <li>if familyName is null,
+	 *             <li>if componentProfile is null,
+	 *             <li>if a ComponentFamily with this name already exists,
+	 *             <li>if there is a problem accessing the ComponentRegistry.
+	 *             </ul>
+	 */
+	Family createComponentFamily(String familyName, Profile componentProfile,
+			String description, License license, SharingPolicy sharingPolicy)
+			throws ComponentException;
+
+	/**
+	 * Returns the ComponentFamily with the specified name.
+	 * <p>
+	 * If this ComponentRegistry does not contain a ComponentFamily with the
+	 * specified name <code>null</code> is returned.
+	 * 
+	 * @param familyName
+	 *            the name of the ComponentFamily to return. Must not be null.
+	 * @return the ComponentFamily with the specified name in this
+	 *         ComponentRepository or null if none exists.
+	 * @throws ComponentException
+	 *             if there is a problem accessing the ComponentRegistry.
+	 */
+	Family getComponentFamily(String familyName) throws ComponentException;
+
+	/**
+	 * @return A description of the type of registry this is.
+	 */
+	String getRegistryTypeName();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/SharingPolicy.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/SharingPolicy.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/SharingPolicy.java
new file mode 100644
index 0000000..ba91276
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/SharingPolicy.java
@@ -0,0 +1,17 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.component.api;
+
+/**
+ * @author alanrw
+ *
+ */
+public interface SharingPolicy {
+	
+	/**
+	 * @return The user-relevant name of the permission
+	 */
+	public abstract String getName();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Version.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Version.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Version.java
new file mode 100644
index 0000000..3f81739
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Version.java
@@ -0,0 +1,206 @@
+package net.sf.taverna.t2.component.api;
+
+import java.io.Serializable;
+import java.net.URL;
+
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+public interface Version {
+	/** @return The version number of this version */
+	Integer getVersionNumber();
+
+	/** @return The description of this version */
+	String getDescription();
+
+	/** @return The implementation for this version */
+	WorkflowBundle getImplementation() throws ComponentException;
+
+	/** @return The component of which this is a version */
+	Component getComponent();
+
+	/** @return The identification token for this version */
+	ID getID();
+
+	URL getHelpURL();
+
+	interface ID extends Serializable {
+		/** @return The name of the family of the component to which we refer to */
+		String getFamilyName();
+
+		/** @return The base URL of the registry containing the component */
+		URL getRegistryBase();
+
+		/**
+		 * @return The name of the component referred to, unique within its
+		 *         family
+		 */
+		String getComponentName();
+
+		/**
+		 * @return The version number of the version of the component referred
+		 *         to
+		 */
+		Integer getComponentVersion();
+
+		/**
+		 * Tests whether this ID is equal to the given one, <i>excluding</i> the
+		 * version.
+		 * 
+		 * @param id
+		 *            The ID to compare to.
+		 * @return A boolean
+		 */
+		boolean mostlyEqualTo(ID id);
+
+		/**
+		 * Tests whether this ID is equal to the given component,
+		 * <i>excluding</i> the version.
+		 * 
+		 * @param component
+		 *            The component to compare to.
+		 * @return A boolean
+		 */
+		boolean mostlyEqualTo(Component component);
+	}
+
+	class Identifier implements ID {
+		private static final long serialVersionUID = 1139928258250264997L;
+
+		private final URL registryBase;
+		private final String familyName;
+		private final String componentName;
+		private final Integer componentVersion;
+
+		public Identifier(URL registryBase, String familyName,
+				String componentName, Integer componentVersion) {
+			super();
+			this.registryBase = registryBase;
+			this.familyName = familyName;
+			this.componentName = componentName;
+			this.componentVersion = componentVersion;
+		}
+
+		/**
+		 * @return the registryBase
+		 */
+		@Override
+		public URL getRegistryBase() {
+			return registryBase;
+		}
+
+		/**
+		 * @return the familyName
+		 */
+		@Override
+		public String getFamilyName() {
+			return familyName;
+		}
+
+		/**
+		 * @return the componentName
+		 */
+		@Override
+		public String getComponentName() {
+			return componentName;
+		}
+
+		/**
+		 * @return the componentVersion
+		 */
+		@Override
+		public Integer getComponentVersion() {
+			return componentVersion;
+		}
+
+		@Override
+		public int hashCode() {
+			final int prime = 31;
+			int result = 1;
+			result *= prime;
+			result += (componentName == null) ? 0 : componentName.hashCode();
+			result *= prime;
+			result += (componentVersion == null) ? 0 : componentVersion
+					.hashCode();
+			result *= prime;
+			result += (familyName == null) ? 0 : familyName.hashCode();
+			result *= prime;
+			result += (registryBase == null) ? 0 : registryBase.hashCode();
+			return result;
+		}
+
+		@Override
+		public boolean equals(Object obj) {
+			if (this == obj)
+				return true;
+			if (obj == null)
+				return false;
+			if (!ID.class.isAssignableFrom(obj.getClass()))
+				return false;
+			ID other = (ID) obj;
+			if (componentName == null) {
+				if (other.getComponentName() != null)
+					return false;
+			} else if (!componentName.equals(other.getComponentName()))
+				return false;
+			if (componentVersion == null) {
+				if (other.getComponentVersion() != null)
+					return false;
+			} else if (!componentVersion.equals(other.getComponentVersion()))
+				return false;
+			if (familyName == null) {
+				if (other.getFamilyName() != null)
+					return false;
+			} else if (!familyName.equals(other.getFamilyName()))
+				return false;
+			if (registryBase == null) {
+				if (other.getRegistryBase() != null)
+					return false;
+			} else if (!registryBase.toString().equals(
+					other.getRegistryBase().toString()))
+				// NB: Comparison of URLs is on their string form!
+				return false;
+			return true;
+		}
+
+		@Override
+		public String toString() {
+			return getComponentName() + " V. " + getComponentVersion()
+					+ " in family " + getFamilyName() + " on "
+					+ getRegistryBase().toExternalForm();
+		}
+
+		@Override
+		public boolean mostlyEqualTo(ID id) {
+			if (this == id)
+				return true;
+			if (id == null)
+				return false;
+			if (getClass() != id.getClass())
+				return false;
+			if (componentName == null) {
+				if (id.getFamilyName() != null)
+					return false;
+			} else if (!componentName.equals(id.getComponentName()))
+				return false;
+			if (familyName == null) {
+				if (id.getFamilyName() != null)
+					return false;
+			} else if (!familyName.equals(id.getFamilyName()))
+				return false;
+			if (registryBase == null) {
+				if (id.getRegistryBase() != null)
+					return false;
+			} else if (!registryBase.toString().equals(
+					id.getRegistryBase().toString()))
+				// NB: Comparison of URLs is on their string form!
+				return false;
+			return true;
+		}
+
+		@Override
+		public boolean mostlyEqualTo(Component c) {
+			return mostlyEqualTo(new Identifier(c.getRegistry()
+					.getRegistryBase(), c.getFamily().getName(), c.getName(), 0));
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentConfig.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentConfig.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentConfig.java
new file mode 100644
index 0000000..172662d
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentConfig.java
@@ -0,0 +1,5 @@
+package net.sf.taverna.t2.component.api.config;
+
+public interface ComponentConfig {
+	String URI = "http://ns.taverna.org.uk/2010/activity/component";
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentPropertyNames.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentPropertyNames.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentPropertyNames.java
new file mode 100644
index 0000000..baa8bb3
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentPropertyNames.java
@@ -0,0 +1,14 @@
+package net.sf.taverna.t2.component.api.config;
+
+/**
+ * The names of properties used in JSON configurations associated with
+ * components.
+ * 
+ * @author Donal Fellows
+ */
+public interface ComponentPropertyNames {
+	String REGISTRY_BASE = "registryBase";
+	String FAMILY_NAME = "familyName";
+	String COMPONENT_NAME = "componentName";
+	String COMPONENT_VERSION = "componentVersion";
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/package-info.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/package-info.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/package-info.java
new file mode 100644
index 0000000..4af7984
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/package-info.java
@@ -0,0 +1,6 @@
+/**
+ * An abstract API for working with components in a registry.
+ * @author Donal Fellows
+ * @author David Withers
+ */
+package net.sf.taverna.t2.component.api;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ActivityProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ActivityProfile.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ActivityProfile.java
new file mode 100644
index 0000000..f656dd0
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ActivityProfile.java
@@ -0,0 +1,5 @@
+package net.sf.taverna.t2.component.api.profile;
+
+public interface ActivityProfile extends AnnotatedElement {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/AnnotatedElement.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/AnnotatedElement.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/AnnotatedElement.java
new file mode 100644
index 0000000..dafec43
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/AnnotatedElement.java
@@ -0,0 +1,10 @@
+package net.sf.taverna.t2.component.api.profile;
+
+import java.util.List;
+
+import net.sf.taverna.t2.component.api.ComponentException;
+
+public interface AnnotatedElement {
+	List<SemanticAnnotationProfile> getSemanticAnnotations()
+			throws ComponentException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionHandling.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionHandling.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionHandling.java
new file mode 100644
index 0000000..5172f94
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionHandling.java
@@ -0,0 +1,32 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.component.api.profile;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author alanrw
+ * 
+ */
+public class ExceptionHandling {
+	private final boolean failLists;
+	private final List<HandleException> remapped = new ArrayList<HandleException>();
+
+	public ExceptionHandling(
+			net.sf.taverna.t2.component.api.profile.doc.ExceptionHandling proxied) {
+		for (net.sf.taverna.t2.component.api.profile.doc.HandleException he : proxied
+				.getHandleException())
+			remapped.add(new HandleException(he));
+		this.failLists = proxied.getFailLists() != null;
+	}
+
+	public boolean failLists() {
+		return failLists;
+	}
+
+	public List<HandleException> getHandleExceptions() {
+		return remapped;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionReplacement.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionReplacement.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionReplacement.java
new file mode 100644
index 0000000..e71c5ec
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionReplacement.java
@@ -0,0 +1,27 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.component.api.profile;
+
+import net.sf.taverna.t2.component.api.profile.doc.Replacement;
+
+/**
+ * @author alanrw
+ * 
+ */
+public class ExceptionReplacement {
+	private final String id, message;
+
+	public ExceptionReplacement(Replacement replacement) {
+		id = replacement.getReplacementId();
+		message = replacement.getReplacementMessage();
+	}
+
+	public String getReplacementId() {
+		return id;
+	}
+
+	public String getReplacementMessage() {
+		return message;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/HandleException.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/HandleException.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/HandleException.java
new file mode 100644
index 0000000..1c3332b
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/HandleException.java
@@ -0,0 +1,39 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.component.api.profile;
+
+import static java.util.regex.Pattern.DOTALL;
+import static java.util.regex.Pattern.compile;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author alanrw
+ * 
+ */
+public class HandleException {
+	private final Pattern pattern;
+	private ExceptionReplacement replacement;
+	private final boolean pruneStack;
+
+	public HandleException(
+			net.sf.taverna.t2.component.api.profile.doc.HandleException proxied) {
+		pruneStack = proxied.getPruneStack() != null;
+		pattern = compile(proxied.getPattern(), DOTALL);
+		if (proxied.getReplacement() != null)
+			replacement = new ExceptionReplacement(proxied.getReplacement());
+	}
+
+	public boolean matches(String s) {
+		return pattern.matcher(s).matches();
+	}
+
+	public boolean pruneStack() {
+		return pruneStack;
+	}
+
+	public ExceptionReplacement getReplacement() {
+		return replacement;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/PortProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/PortProfile.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/PortProfile.java
new file mode 100644
index 0000000..5d66de8
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/PortProfile.java
@@ -0,0 +1,5 @@
+package net.sf.taverna.t2.component.api.profile;
+
+
+public interface PortProfile extends AnnotatedElement {
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/Profile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/Profile.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/Profile.java
new file mode 100644
index 0000000..c0899f8
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/Profile.java
@@ -0,0 +1,47 @@
+package net.sf.taverna.t2.component.api.profile;
+
+import java.util.List;
+import java.util.Map;
+
+import net.sf.taverna.t2.component.api.NamedItem;
+import net.sf.taverna.t2.component.api.Registry;
+import net.sf.taverna.t2.component.api.ComponentException;
+
+import com.hp.hpl.jena.ontology.OntModel;
+
+public interface Profile extends NamedItem, AnnotatedElement {
+
+	Registry getComponentRegistry();
+
+	String getXML() throws ComponentException;
+
+	net.sf.taverna.t2.component.api.profile.doc.Profile getProfileDocument()
+			throws ComponentException;
+
+	String getId();
+
+	String getOntologyLocation(String ontologyId);
+
+	Map<String, String> getPrefixMap() throws ComponentException;
+
+	OntModel getOntology(String ontologyId);
+
+	List<PortProfile> getInputPortProfiles();
+
+	List<SemanticAnnotationProfile> getInputSemanticAnnotationProfiles()
+			throws ComponentException;
+
+	List<PortProfile> getOutputPortProfiles();
+
+	List<SemanticAnnotationProfile> getOutputSemanticAnnotationProfiles()
+			throws ComponentException;
+
+	List<ActivityProfile> getActivityProfiles();
+
+	List<SemanticAnnotationProfile> getActivitySemanticAnnotationProfiles()
+			throws ComponentException;
+
+	ExceptionHandling getExceptionHandling();
+
+	void delete() throws ComponentException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/SemanticAnnotationProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/SemanticAnnotationProfile.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/SemanticAnnotationProfile.java
new file mode 100644
index 0000000..3000576
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/SemanticAnnotationProfile.java
@@ -0,0 +1,54 @@
+package net.sf.taverna.t2.component.api.profile;
+
+import java.util.List;
+
+import com.hp.hpl.jena.ontology.Individual;
+import com.hp.hpl.jena.ontology.OntClass;
+import com.hp.hpl.jena.ontology.OntModel;
+import com.hp.hpl.jena.ontology.OntProperty;
+
+public interface SemanticAnnotationProfile {
+
+	/**
+	 * Returns the ontology that defines semantic annotation.
+	 * 
+	 * @return the ontology that defines semantic annotation
+	 */
+	OntModel getOntology();
+
+	/**
+	 * Returns the predicate for the semantic annotation.
+	 * 
+	 * @return the predicate for the semantic annotation
+	 */
+	OntProperty getPredicate();
+
+	String getPredicateString();
+
+	String getClassString();
+
+	/**
+	 * Returns the individual that the semantic annotation must use.
+	 * 
+	 * May be null if no explicit individual is required.
+	 * 
+	 * @return the individual that the semantic annotation must use
+	 */
+	Individual getIndividual();
+
+	/**
+	 * Returns the individuals in the range of the predicate defined in the
+	 * ontology.
+	 * 
+	 * @return the individuals in the range of the predicate defined in the
+	 *         ontology
+	 */
+	List<Individual> getIndividuals();
+
+	Integer getMinOccurs();
+
+	Integer getMaxOccurs();
+
+	OntClass getRangeClass();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd b/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd
new file mode 100644
index 0000000..95b4405
--- /dev/null
+++ b/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd
@@ -0,0 +1,261 @@
+<?xml version="1.0"?>
+<xs:schema targetNamespace="http://ns.taverna.org.uk/2012/component/profile"
+	elementFormDefault="qualified" xmlns="http://ns.taverna.org.uk/2012/component/profile"
+	xmlns:cp="http://ns.taverna.org.uk/2012/component/profile" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
+	jxb:version="2.1">
+	<xs:annotation>
+		<xs:appinfo>
+			<jxb:schemaBindings>
+				<jxb:package name="net.sf.taverna.t2.component.api.profile.doc" />
+			</jxb:schemaBindings>
+		</xs:appinfo>
+	</xs:annotation>
+
+	<xs:import namespace="http://www.w3.org/2001/XMLSchema"
+		schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" />
+
+	<xs:simpleType name="name">
+		<xs:annotation>
+			<xs:documentation>A valid name for a port or activity in a Taverna
+				workflow.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string">
+			<xs:pattern value="([a-zA_Z0-9_])+" />
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="componentElements">
+		<xs:annotation>
+			<xs:documentation>
+				The component elements that can be annotated.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="InputPort"></xs:enumeration>
+			<xs:enumeration value="OutputPort"></xs:enumeration>
+			<xs:enumeration value="Activity"></xs:enumeration>
+			<xs:enumeration value="Component"></xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="basicAnnotations">
+		<xs:annotation>
+			<xs:documentation>
+				The basic annotations available in a Taverna
+				workflow.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="Description"></xs:enumeration>
+			<xs:enumeration value="Author"></xs:enumeration>
+			<xs:enumeration value="Example"></xs:enumeration>
+			<xs:enumeration value="Title"></xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="componentAnnotations">
+		<xs:annotation>
+			<xs:documentation>
+				Annotations applicable to components.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="basicAnnotations">
+			<xs:enumeration value="Description"></xs:enumeration>
+			<xs:enumeration value="Author"></xs:enumeration>
+			<xs:enumeration value="Title"></xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="portAnnotations">
+		<xs:annotation>
+			<xs:documentation>
+				Annotations applicable to ports.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="basicAnnotations">
+			<xs:enumeration value="Description"></xs:enumeration>
+			<xs:enumeration value="Example"></xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="activityAnnotations">
+		<xs:annotation>
+			<xs:documentation>
+				Annotations applicable to activities.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="basicAnnotations">
+			<xs:enumeration value="Description"></xs:enumeration>
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:complexType name="componentAnnotation">
+		<xs:simpleContent>
+			<xs:extension base="componentAnnotations">
+				<xs:attributeGroup ref="xs:occurs" />
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+
+	<xs:complexType name="portAnnotation">
+		<xs:simpleContent>
+			<xs:extension base="portAnnotations">
+				<xs:attributeGroup ref="xs:occurs" />
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+
+	<xs:complexType name="activityAnnotation">
+		<xs:simpleContent>
+			<xs:extension base="activityAnnotations">
+				<xs:attributeGroup ref="xs:occurs" />
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+
+	<xs:complexType name="semanticAnnotation">
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attribute name="ontology" type="xs:string" use="required" />
+				<xs:attribute name="predicate" type="xs:string" use="required" />
+				<xs:attribute name="class" type="xs:string" use="optional" />
+				<xs:attributeGroup ref="xs:occurs" />
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+
+	<xs:complexType name="ontology">
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attribute name="id" type="xs:string" use="required" />
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+
+	<xs:complexType name="port">
+		<xs:sequence>
+			<xs:element name="annotation" type="portAnnotation"
+				minOccurs="0" maxOccurs="unbounded" />
+			<xs:element name="semanticAnnotation" type="semanticAnnotation"
+				minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+		<xs:attribute name="name" type="name" />
+		<xs:attribute name="minDepth" type="xs:nonNegativeInteger"
+			default="0" />
+		<xs:attribute name="maxDepth" type="xs:allNNI" default="unbounded" />
+		<xs:attributeGroup ref="xs:occurs" />
+	</xs:complexType>
+
+	<xs:complexType name="activity">
+		<xs:sequence>
+			<xs:element name="annotation" type="activityAnnotation"
+				minOccurs="0" maxOccurs="unbounded" />
+			<xs:element name="semanticAnnotation" type="semanticAnnotation"
+				minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+		<xs:attribute name="type" type="xs:string" />
+		<xs:attributeGroup ref="xs:occurs" />
+	</xs:complexType>
+	
+	<xs:complexType name="replacement">
+	  <xs:complexContent>
+		  <xs:restriction base="xs:anyType">
+	    	<xs:attribute name="replacementId" type="xs:string" use="required"/>
+	    	<xs:attribute name="replacementMessage" type="xs:string" use="required"/>
+	    </xs:restriction>
+	  </xs:complexContent>
+	</xs:complexType>
+	
+	<xs:simpleType name="pattern">
+		<xs:restriction base="xs:string">
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:complexType name="pruneStack">
+	  <xs:complexContent>
+		  <xs:restriction base="xs:anyType"/>
+	  </xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="handleException">
+	  <xs:sequence>
+	    <xs:element name="pattern" type="pattern" minOccurs="1" maxOccurs="1"/>
+	    <xs:element name="pruneStack" type="pruneStack" minOccurs="0" maxOccurs="1"/>
+	    <xs:element name="replacement" type="replacement" minOccurs="0" maxOccurs="1"/>
+	  </xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="failLists">
+	  <xs:complexContent>
+		  <xs:restriction base="xs:anyType"/>
+	  </xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="exceptionHandling">
+	  <xs:sequence>
+	      <xs:element name="failLists" type="failLists" minOccurs="0" maxOccurs="1"/>
+	  	<xs:element name="handleException" type="handleException" minOccurs="1" maxOccurs="unbounded"/>
+	  </xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="component">
+		<xs:sequence>
+			<xs:element name="inputPort" type="port" minOccurs="0" maxOccurs="unbounded" />
+			<xs:element name="outputPort" type="port" minOccurs="0" maxOccurs="unbounded" />
+			<xs:element name="activity" type="activity" minOccurs="0" maxOccurs="unbounded" />
+			<xs:element name="annotation" type="componentAnnotation" minOccurs="0" maxOccurs="unbounded" />
+			<xs:element name="semanticAnnotation" type="semanticAnnotation" minOccurs="0" maxOccurs="unbounded" />
+			<xs:element name="exceptionHandling" type="exceptionHandling" minOccurs="0" maxOccurs="1"/>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="extends">
+	  <xs:attribute name="profileId" type="xs:string" use="required"/>
+	</xs:complexType>
+
+	<xs:element name="profile">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="id" type="xs:string" />
+				<xs:element name="name" type="xs:string" />
+				<xs:element name="description" type="xs:string" />
+				<xs:element name="extends" type="extends" minOccurs = "0" />
+				<xs:element name="ontology" type="ontology" minOccurs="0" maxOccurs="unbounded" />
+				<xs:element name="component" type="component" >
+					<xs:unique name="inputPortUnique">
+						<xs:selector xpath="cp:inputPort"></xs:selector>
+						<xs:field xpath="@name"></xs:field>
+					</xs:unique>
+					<xs:unique name="outputPortUnique">
+						<xs:selector xpath="cp:outputPort" />
+						<xs:field xpath="@name" />
+					</xs:unique>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+		<xs:key name="ontologyKey">
+			<xs:selector xpath="cp:ontology" />
+			<xs:field xpath="@id" />
+		</xs:key>
+		<xs:keyref name="componentKeyRef" refer="ontologyKey">
+			<xs:selector xpath="cp:component/cp:semanticAnnotation" />
+			<xs:field xpath="@ontology" />
+		</xs:keyref>
+		<xs:keyref name="inputKeyRef" refer="ontologyKey">
+			<xs:selector xpath="cp:component/cp:inputPorts/cp:inputPort/cp:semanticAnnotation" />
+			<xs:field xpath="@ontology" />
+		</xs:keyref>
+		<xs:keyref name="outputKeyRef" refer="ontologyKey">
+			<xs:selector xpath="cp:component/cp:outputPorts/cp:outputPort/cp:semanticAnnotation" />
+			<xs:field xpath="@ontology" />
+		</xs:keyref>
+		<xs:keyref name="activityKeyRef" refer="ontologyKey">
+			<xs:selector xpath="cp:component/cp:activities/cp:activity/cp:semanticAnnotation" />
+			<xs:field xpath="@ontology" />
+		</xs:keyref>
+	</xs:element>
+
+</xs:schema>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/c70b61ee/taverna-component-repository/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-component-repository/pom.xml b/taverna-component-repository/pom.xml
deleted file mode 100644
index 72c9560..0000000
--- a/taverna-component-repository/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>org.apache.taverna.engine</groupId>
-		<artifactId>taverna-engine</artifactId>
-		<version>3.1.0-incubating-SNAPSHOT</version>
-	</parent>
-	<artifactId>taverna-component-repository-api</artifactId>
-	<packaging>bundle</packaging>
-	<name>Apache Taverna Component Repository API</name>
-	<inceptionYear>2014</inceptionYear>
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.taverna.language</groupId>
-			<artifactId>taverna-scufl2-api</artifactId>
-			<version>${taverna.language.version}</version>
-		</dependency>
-		<dependency>
-			<!-- FIXME: Use jena-osgi bundle -->
-			<groupId>org.apache.clerezza.ext</groupId>
-			<artifactId>com.hp.hpl.jena</artifactId>
-			<version>0.6-incubating</version>
-		</dependency>
-	</dependencies>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.felix</groupId>
-				<artifactId>maven-bundle-plugin</artifactId>
-				<extensions>true</extensions>
-				<configuration>
-					<instructions>
-						<Export-Package>org.apache.taverna.component.api,org.apache.taverna.component.api.profile,org.apache.taverna.component.api.profile.doc</Export-Package>
-					</instructions>
-				</configuration>
-			</plugin>
-			<plugin>
-				<groupId>org.jvnet.jaxb2.maven2</groupId>
-				<artifactId>maven-jaxb2-plugin</artifactId>
-				<version>0.8.3</version>
-				<executions>
-					<execution>
-						<goals>
-							<goal>generate</goal>
-						</goals>
-						<configuration>
-							<catalog>${basedir}/src/main/catalog/catalog.xml</catalog>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-</project>