/******************************************************************************* * Copyright (c) 2004, 2007-2008 IBM Corporation and Cambridge Semantics Incorporated. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * File: $Source$ * Created by: Generated Source from org.openanzo.jdbc.utils.opgen.jet * Created on: Generated Source from org.openanzo.jdbc.utils.opgen.jet * Revision: $Id$ * * Contributors: * IBM Corporation - initial API and implementation * Cambridge Semantics Incorporated - Fork to Anzo *******************************************************************************/ package org.openanzo.rdf.jastor.collections; /** * Factory for instantiating objects for ontology classes in the Collections ontology. The * get methods leave the dataset unchanged and return a Java view of the object in the dataset. The create methods * may add certain baseline properties to the dataset such as rdf:type and any properties with hasValue restrictions. * <p>(URI: http://openanzo.org/ontologies/Collections)</p> * <br> * <br> * <br> */ public class CollectionsFactory extends org.openanzo.rdf.jastor.ThingFactory { /** *Determine if the given predicate is one of the properties for the given class *@param predicate predicate to check *@return true if the given predicate is one of the properties for the given class */ public static boolean isResourceItemPredicate(org.openanzo.rdf.URI predicate){ return predicate.equals(ResourceItem.itemObjectProperty) ; } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the ResourceItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem createResourceItem(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI _namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { ResourceItem result= org.openanzo.rdf.jastor.collections.ResourceItemImpl.createResourceItem(resource,_namedGraphUri,dataset); return result; } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the ResourceItem * @param dataset the IDataset containing the data * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem createResourceItem(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return createResourceItem(resource, resource, dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the ResourceItem * @param dataset the IDataset containing the data * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem createResourceItem(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createResourceItem(resource, resource, dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the ResourceItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem createResourceItem(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createResourceItem(resource, _namedGraphUri, dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the ResourceItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem createResourceItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return createResourceItem(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the ResourceItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem createResourceItem(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createResourceItem(resource, graph); } /** * Create a new instance of ResourceItem. Leaves the dataset unchanged. * @param resource The resource of the ResourceItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem getResourceItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return org.openanzo.rdf.jastor.collections.ResourceItemImpl.getResourceItem(resource, _namedGraphUri,dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the ResourceItem * @param dataset the IDataset containing the data * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem getResourceItem(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getResourceItem(resource, resource, dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the ResourceItem * @param dataset the IDataset containing the data * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem getResourceItem(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getResourceItem(resource, resource, dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the ResourceItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem getResourceItem(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getResourceItem(resource, _namedGraphUri, dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the ResourceItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem getResourceItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getResourceItem(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of ResourceItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the ResourceItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static ResourceItem getResourceItem(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getResourceItem(resource, graph); } /** * Return an instance of ResourceItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#ResourceItem * @param _namedGraphUri the URI of the NamedGraph * @param dataset the IDataset containing the data * @return a List of ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<ResourceItem> getAllResourceItem(org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> result = dataset.find(null,org.openanzo.rdf.vocabulary.RDF.TYPE,ResourceItem.TYPE,_namedGraphUri); java.util.List<ResourceItem> list = new java.util.ArrayList<ResourceItem>(); for(org.openanzo.rdf.Statement stmt :result){ org.openanzo.rdf.URI nguri = _namedGraphUri != null ? _namedGraphUri : (org.openanzo.rdf.URI)stmt.getSubject(); list.add(getResourceItem(stmt.getSubject(),nguri,dataset)); } return list; } /** * Return an instance of ResourceItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#ResourceItem * @param dataset the IDataset containing the data * @return a List of ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<ResourceItem> getAllResourceItem(org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getAllResourceItem(null, dataset); } /** * Return an instance of ResourceItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#ResourceItem * @param graph the NamedGraph containing the data * @return a List of ResourceItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<ResourceItem> getAllResourceItem(org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getAllResourceItem(graph.getNamedGraphUri(), dataset); } /** *Determine if the given predicate is one of the properties for the given class *@param predicate predicate to check *@return true if the given predicate is one of the properties for the given class */ public static boolean isOrderedItemPredicate(org.openanzo.rdf.URI predicate){ return predicate.equals(OrderedItem.nextItemProperty) || predicate.equals(OrderedItem.previousItemProperty) ; } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem createOrderedItem(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI _namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { OrderedItem result= org.openanzo.rdf.jastor.collections.OrderedItemImpl.createOrderedItem(resource,_namedGraphUri,dataset); return result; } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedItem * @param dataset the IDataset containing the data * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem createOrderedItem(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return createOrderedItem(resource, resource, dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedItem * @param dataset the IDataset containing the data * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem createOrderedItem(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createOrderedItem(resource, resource, dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem createOrderedItem(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createOrderedItem(resource, _namedGraphUri, dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem createOrderedItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return createOrderedItem(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem createOrderedItem(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createOrderedItem(resource, graph); } /** * Create a new instance of OrderedItem. Leaves the dataset unchanged. * @param resource The resource of the OrderedItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem getOrderedItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return org.openanzo.rdf.jastor.collections.OrderedItemImpl.getOrderedItem(resource, _namedGraphUri,dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedItem * @param dataset the IDataset containing the data * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem getOrderedItem(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getOrderedItem(resource, resource, dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedItem * @param dataset the IDataset containing the data * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem getOrderedItem(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getOrderedItem(resource, resource, dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem getOrderedItem(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getOrderedItem(resource, _namedGraphUri, dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem getOrderedItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getOrderedItem(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of OrderedItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedItem getOrderedItem(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getOrderedItem(resource, graph); } /** * Return an instance of OrderedItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#OrderedItem * @param _namedGraphUri the URI of the NamedGraph * @param dataset the IDataset containing the data * @return a List of OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<OrderedItem> getAllOrderedItem(org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> result = dataset.find(null,org.openanzo.rdf.vocabulary.RDF.TYPE,OrderedItem.TYPE,_namedGraphUri); java.util.List<OrderedItem> list = new java.util.ArrayList<OrderedItem>(); for(org.openanzo.rdf.Statement stmt :result){ org.openanzo.rdf.URI nguri = _namedGraphUri != null ? _namedGraphUri : (org.openanzo.rdf.URI)stmt.getSubject(); list.add(getOrderedItem(stmt.getSubject(),nguri,dataset)); } return list; } /** * Return an instance of OrderedItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#OrderedItem * @param dataset the IDataset containing the data * @return a List of OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<OrderedItem> getAllOrderedItem(org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getAllOrderedItem(null, dataset); } /** * Return an instance of OrderedItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#OrderedItem * @param graph the NamedGraph containing the data * @return a List of OrderedItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<OrderedItem> getAllOrderedItem(org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getAllOrderedItem(graph.getNamedGraphUri(), dataset); } /** *Determine if the given predicate is one of the properties for the given class *@param predicate predicate to check *@return true if the given predicate is one of the properties for the given class */ public static boolean isOrderedCollectionPredicate(org.openanzo.rdf.URI predicate){ return predicate.equals(OrderedCollection.itemProperty) || predicate.equals(OrderedCollection.collectionSizeProperty) || predicate.equals(OrderedCollection.firstItemProperty) ; } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedCollection * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection createOrderedCollection(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI _namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { OrderedCollection result= org.openanzo.rdf.jastor.collections.OrderedCollectionImpl.createOrderedCollection(resource,_namedGraphUri,dataset); return result; } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedCollection * @param dataset the IDataset containing the data * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection createOrderedCollection(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return createOrderedCollection(resource, resource, dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedCollection * @param dataset the IDataset containing the data * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection createOrderedCollection(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createOrderedCollection(resource, resource, dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedCollection * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection createOrderedCollection(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createOrderedCollection(resource, _namedGraphUri, dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedCollection * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection createOrderedCollection(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return createOrderedCollection(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedCollection * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection createOrderedCollection(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createOrderedCollection(resource, graph); } /** * Create a new instance of OrderedCollection. Leaves the dataset unchanged. * @param resource The resource of the OrderedCollection * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection getOrderedCollection(org.openanzo.rdf.Resource resource, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return org.openanzo.rdf.jastor.collections.OrderedCollectionImpl.getOrderedCollection(resource, _namedGraphUri,dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedCollection * @param dataset the IDataset containing the data * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection getOrderedCollection(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getOrderedCollection(resource, resource, dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedCollection * @param dataset the IDataset containing the data * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection getOrderedCollection(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getOrderedCollection(resource, resource, dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedCollection * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection getOrderedCollection(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getOrderedCollection(resource, _namedGraphUri, dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the OrderedCollection * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection getOrderedCollection(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getOrderedCollection(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of OrderedCollection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the OrderedCollection * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static OrderedCollection getOrderedCollection(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getOrderedCollection(resource, graph); } /** * Return an instance of OrderedCollection for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#OrderedCollection * @param _namedGraphUri the URI of the NamedGraph * @param dataset the IDataset containing the data * @return a List of OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<OrderedCollection> getAllOrderedCollection(org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> result = dataset.find(null,org.openanzo.rdf.vocabulary.RDF.TYPE,OrderedCollection.TYPE,_namedGraphUri); java.util.List<OrderedCollection> list = new java.util.ArrayList<OrderedCollection>(); for(org.openanzo.rdf.Statement stmt :result){ org.openanzo.rdf.URI nguri = _namedGraphUri != null ? _namedGraphUri : (org.openanzo.rdf.URI)stmt.getSubject(); list.add(getOrderedCollection(stmt.getSubject(),nguri,dataset)); } return list; } /** * Return an instance of OrderedCollection for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#OrderedCollection * @param dataset the IDataset containing the data * @return a List of OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<OrderedCollection> getAllOrderedCollection(org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getAllOrderedCollection(null, dataset); } /** * Return an instance of OrderedCollection for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#OrderedCollection * @param graph the NamedGraph containing the data * @return a List of OrderedCollection * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<OrderedCollection> getAllOrderedCollection(org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getAllOrderedCollection(graph.getNamedGraphUri(), dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Item * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item createItem(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI _namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { Item result= org.openanzo.rdf.jastor.collections.ItemImpl.createItem(resource,_namedGraphUri,dataset); return result; } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Item * @param dataset the IDataset containing the data * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item createItem(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return createItem(resource, resource, dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Item * @param dataset the IDataset containing the data * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item createItem(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createItem(resource, resource, dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Item * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item createItem(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createItem(resource, _namedGraphUri, dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Item * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item createItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return createItem(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Item * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item createItem(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createItem(resource, graph); } /** * Create a new instance of Item. Leaves the dataset unchanged. * @param resource The resource of the Item * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item getItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return org.openanzo.rdf.jastor.collections.ItemImpl.getItem(resource, _namedGraphUri,dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Item * @param dataset the IDataset containing the data * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item getItem(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getItem(resource, resource, dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Item * @param dataset the IDataset containing the data * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item getItem(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getItem(resource, resource, dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Item * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item getItem(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getItem(resource, _namedGraphUri, dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Item * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item getItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getItem(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of Item. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Item * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created Item * @throws org.openanzo.rdf.jastor.JastorException */ public static Item getItem(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getItem(resource, graph); } /** * Return an instance of Item for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#Item * @param _namedGraphUri the URI of the NamedGraph * @param dataset the IDataset containing the data * @return a List of Item * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<Item> getAllItem(org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> result = dataset.find(null,org.openanzo.rdf.vocabulary.RDF.TYPE,Item.TYPE,_namedGraphUri); java.util.List<Item> list = new java.util.ArrayList<Item>(); for(org.openanzo.rdf.Statement stmt :result){ org.openanzo.rdf.URI nguri = _namedGraphUri != null ? _namedGraphUri : (org.openanzo.rdf.URI)stmt.getSubject(); list.add(getItem(stmt.getSubject(),nguri,dataset)); } return list; } /** * Return an instance of Item for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#Item * @param dataset the IDataset containing the data * @return a List of Item * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<Item> getAllItem(org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getAllItem(null, dataset); } /** * Return an instance of Item for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#Item * @param graph the NamedGraph containing the data * @return a List of Item * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<Item> getAllItem(org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getAllItem(graph.getNamedGraphUri(), dataset); } /** *Determine if the given predicate is one of the properties for the given class *@param predicate predicate to check *@return true if the given predicate is one of the properties for the given class */ public static boolean isCollectionPredicate(org.openanzo.rdf.URI predicate){ return predicate.equals(Collection.itemProperty) ; } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Collection * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection createCollection(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI _namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { Collection result= org.openanzo.rdf.jastor.collections.CollectionImpl.createCollection(resource,_namedGraphUri,dataset); return result; } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Collection * @param dataset the IDataset containing the data * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection createCollection(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return createCollection(resource, resource, dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Collection * @param dataset the IDataset containing the data * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection createCollection(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createCollection(resource, resource, dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Collection * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection createCollection(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createCollection(resource, _namedGraphUri, dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Collection * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection createCollection(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return createCollection(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Collection * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection createCollection(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createCollection(resource, graph); } /** * Create a new instance of Collection. Leaves the dataset unchanged. * @param resource The resource of the Collection * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection getCollection(org.openanzo.rdf.Resource resource, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return org.openanzo.rdf.jastor.collections.CollectionImpl.getCollection(resource, _namedGraphUri,dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Collection * @param dataset the IDataset containing the data * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection getCollection(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getCollection(resource, resource, dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Collection * @param dataset the IDataset containing the data * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection getCollection(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getCollection(resource, resource, dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Collection * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection getCollection(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getCollection(resource, _namedGraphUri, dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the Collection * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection getCollection(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getCollection(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of Collection. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the Collection * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static Collection getCollection(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getCollection(resource, graph); } /** * Return an instance of Collection for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#Collection * @param _namedGraphUri the URI of the NamedGraph * @param dataset the IDataset containing the data * @return a List of Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<Collection> getAllCollection(org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> result = dataset.find(null,org.openanzo.rdf.vocabulary.RDF.TYPE,Collection.TYPE,_namedGraphUri); java.util.List<Collection> list = new java.util.ArrayList<Collection>(); for(org.openanzo.rdf.Statement stmt :result){ org.openanzo.rdf.URI nguri = _namedGraphUri != null ? _namedGraphUri : (org.openanzo.rdf.URI)stmt.getSubject(); list.add(getCollection(stmt.getSubject(),nguri,dataset)); } return list; } /** * Return an instance of Collection for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#Collection * @param dataset the IDataset containing the data * @return a List of Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<Collection> getAllCollection(org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getAllCollection(null, dataset); } /** * Return an instance of Collection for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#Collection * @param graph the NamedGraph containing the data * @return a List of Collection * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<Collection> getAllCollection(org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getAllCollection(graph.getNamedGraphUri(), dataset); } /** *Determine if the given predicate is one of the properties for the given class *@param predicate predicate to check *@return true if the given predicate is one of the properties for the given class */ public static boolean isLiteralItemPredicate(org.openanzo.rdf.URI predicate){ return predicate.equals(LiteralItem.itemDataProperty) ; } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the LiteralItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem createLiteralItem(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI _namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { LiteralItem result= org.openanzo.rdf.jastor.collections.LiteralItemImpl.createLiteralItem(resource,_namedGraphUri,dataset); return result; } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the LiteralItem * @param dataset the IDataset containing the data * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem createLiteralItem(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return createLiteralItem(resource, resource, dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the LiteralItem * @param dataset the IDataset containing the data * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem createLiteralItem(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createLiteralItem(resource, resource, dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the LiteralItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem createLiteralItem(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createLiteralItem(resource, _namedGraphUri, dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the LiteralItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem createLiteralItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return createLiteralItem(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the LiteralItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem createLiteralItem(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return createLiteralItem(resource, graph); } /** * Create a new instance of LiteralItem. Leaves the dataset unchanged. * @param resource The resource of the LiteralItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem getLiteralItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return org.openanzo.rdf.jastor.collections.LiteralItemImpl.getLiteralItem(resource, _namedGraphUri,dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the LiteralItem * @param dataset the IDataset containing the data * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem getLiteralItem(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getLiteralItem(resource, resource, dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the LiteralItem * @param dataset the IDataset containing the data * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem getLiteralItem(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getLiteralItem(resource, resource, dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the LiteralItem * @param _namedGraphUri the URI of the NamedGraph within the dataset where this object is to be created * @param dataset the IDataset containing the data * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem getLiteralItem(String uri, org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getLiteralItem(resource, _namedGraphUri, dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param resource The resource of the LiteralItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem getLiteralItem(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getLiteralItem(resource, graph.getNamedGraphUri(), dataset); } /** * Create a new instance of LiteralItem. Adds the rdf:type property for the given resource to the dataset. * @param uri The uri of the LiteralItem * @param graph the NamedGraph within the dataset where this object is to be created * @return the newly created LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static LiteralItem getLiteralItem(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getLiteralItem(resource, graph); } /** * Return an instance of LiteralItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#LiteralItem * @param _namedGraphUri the URI of the NamedGraph * @param dataset the IDataset containing the data * @return a List of LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<LiteralItem> getAllLiteralItem(org.openanzo.rdf.URI _namedGraphUri,org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> result = dataset.find(null,org.openanzo.rdf.vocabulary.RDF.TYPE,LiteralItem.TYPE,_namedGraphUri); java.util.List<LiteralItem> list = new java.util.ArrayList<LiteralItem>(); for(org.openanzo.rdf.Statement stmt :result){ org.openanzo.rdf.URI nguri = _namedGraphUri != null ? _namedGraphUri : (org.openanzo.rdf.URI)stmt.getSubject(); list.add(getLiteralItem(stmt.getSubject(),nguri,dataset)); } return list; } /** * Return an instance of LiteralItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#LiteralItem * @param dataset the IDataset containing the data * @return a List of LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<LiteralItem> getAllLiteralItem(org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getAllLiteralItem(null, dataset); } /** * Return an instance of LiteralItem for every resource in the dataset with rdf:Type http://openanzo.org/ontologies/2008/07/Collections#LiteralItem * @param graph the NamedGraph containing the data * @return a List of LiteralItem * @throws org.openanzo.rdf.jastor.JastorException */ public static java.util.List<LiteralItem> getAllLiteralItem(org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getAllLiteralItem(graph.getNamedGraphUri(), dataset); } /** * Returns an instance of an interface for the given Resource. The return instance is guaranteed to * implement the most specific interface in *some* hierarchy in which the Resource participates. The behavior * is unspecified for resources with RDF types from different hierarchies. * @return an instance of Thing * @throws org.openanzo.rdf.jastor.JastorException */ public static org.openanzo.rdf.jastor.Thing getThing(org.openanzo.rdf.Resource resource, org.openanzo.rdf.URI namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { if (dataset.contains(resource,org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/Collections#LiteralItem"), namedGraphUri)) { return getLiteralItem(resource, namedGraphUri, dataset); } if (dataset.contains(resource,org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/Collections#OrderedCollection"), namedGraphUri)) { return getOrderedCollection(resource, namedGraphUri, dataset); } if (dataset.contains(resource,org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/Collections#Collection"), namedGraphUri)) { return getCollection(resource, namedGraphUri, dataset); } if (dataset.contains(resource,org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/Collections#OrderedItem"), namedGraphUri)) { return getOrderedItem(resource, namedGraphUri, dataset); } if (dataset.contains(resource,org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/Collections#ResourceItem"), namedGraphUri)) { return getResourceItem(resource, namedGraphUri, dataset); } if (dataset.contains(resource,org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/Collections#Item"), namedGraphUri)) { return getItem(resource, namedGraphUri, dataset); } return new org.openanzo.rdf.jastor.ThingImpl(resource, namedGraphUri, dataset); } /* public static org.openanzo.rdf.jastor.Thing getThing(org.openanzo.rdf.URI resource, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { return getThing(resource, resource, dataset); } public static org.openanzo.rdf.jastor.Thing getThing(String uri, org.openanzo.rdf.URI namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getThing(resource, namedGraphUri, dataset); } public static org.openanzo.rdf.jastor.Thing getThing(String uri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getThing(resource, dataset); } public static org.openanzo.rdf.jastor.Thing getThing(org.openanzo.rdf.Resource resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getThing(resource, graph.getNamedGraphUri(), dataset); } public static org.openanzo.rdf.jastor.Thing getThing(org.openanzo.rdf.URI resource, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.IDataset dataset = org.openanzo.rdf.jastor.SingletonDataset.getInstance(graph); return getThing(resource, graph.getNamedGraphUri(), dataset); } public static org.openanzo.rdf.jastor.Thing getThing(String uri, org.openanzo.rdf.INamedGraph graph) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.URI resource=org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI(uri); return getThing(resource, graph); } */ /** * Return a list of compatible interfaces for the given type. Searches through all ontology classes * in the Collections ontology. * @param type the type for which to find compatible interfaces * @return a List of type java.lang.Class */ public static java.util.List<java.lang.Class<? extends org.openanzo.rdf.jastor.Thing>> listCompatibleInterfaces (org.openanzo.rdf.Resource type) { java.util.List<java.lang.Class<? extends org.openanzo.rdf.jastor.Thing>> types = new java.util.ArrayList<java.lang.Class<? extends org.openanzo.rdf.jastor.Thing>>(); if (type.equals(org.openanzo.rdf.jastor.collections.ResourceItem.TYPE)) { types.add(org.openanzo.rdf.jastor.collections.ResourceItem.class); } if (type.equals(org.openanzo.rdf.jastor.collections.OrderedItem.TYPE)) { types.add(org.openanzo.rdf.jastor.collections.OrderedItem.class); } if (type.equals(org.openanzo.rdf.jastor.collections.OrderedCollection.TYPE)) { types.add(org.openanzo.rdf.jastor.collections.OrderedCollection.class); } if (type.equals(org.openanzo.rdf.jastor.collections.Item.TYPE)) { types.add(org.openanzo.rdf.jastor.collections.Item.class); } if (type.equals(org.openanzo.rdf.jastor.collections.Collection.TYPE)) { types.add(org.openanzo.rdf.jastor.collections.Collection.class); } if (type.equals(org.openanzo.rdf.jastor.collections.LiteralItem.TYPE)) { types.add(org.openanzo.rdf.jastor.collections.LiteralItem.class); } return types; } }