Java Code Examples for org.apache.jena.util.iterator.ExtendedIterator#next()

The following examples show how to use org.apache.jena.util.iterator.ExtendedIterator#next() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: localname.java    From xcurator with Apache License 2.0 6 votes vote down vote up
private QueryIterator execAllNodes(Var subjVar, Node nodeLocalname,  Binding input, ExecutionContext execCxt)
{
    if ( ! nodeLocalname.isVariable() )
    {
        if ( ! nodeLocalname.isLiteral() )
            // Not a variable, not a literal=> can't match
            return QueryIterNullIterator.create(execCxt) ;
    
        if( ! NodeUtils.isSimpleString(nodeLocalname) )
            return QueryIterNullIterator.create(execCxt) ;
    }
    
    //Set bindings = new HashSet() ;    // Use a Set if you want unique results. 
    List<Binding> bindings = new ArrayList<Binding>() ;   // Use a list if you want counting results. 
    Graph graph = execCxt.getActiveGraph() ;
    
    ExtendedIterator<Triple>iter = graph.find(Node.ANY, Node.ANY, Node.ANY) ;
    for ( ; iter.hasNext() ; )
    {
        Triple t = iter.next() ;
        slot(bindings, input, t.getSubject(),   subjVar, nodeLocalname) ;
        slot(bindings, input, t.getPredicate(), subjVar, nodeLocalname) ;
        slot(bindings, input, t.getObject(),    subjVar, nodeLocalname) ;
    }
    return new QueryIterPlainWrapper(bindings.iterator(), execCxt) ;
}
 
Example 2
Source File: RdfModelObject.java    From tools with Apache License 2.0 6 votes vote down vote up
/**
 * Find all annotations with a subject of this object
 * @param nameSpace
 * @param propertyName
 * @return
 * @throws InvalidSPDXAnalysisException 
 */
protected Relationship[] findRelationshipPropertyValues(String nameSpace,
		String propertyName) throws InvalidSPDXAnalysisException {
	if (this.model == null || this.node == null) {
		return null;
	}
	List<Relationship> retval = Lists.newArrayList();
	Node p = model.getProperty(nameSpace, propertyName).asNode();
	Triple m = Triple.createMatch(node, p, null);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
	while (tripleIter.hasNext()) {
		Triple t = tripleIter.next();
		retval.add(new Relationship(this.modelContainer, t.getObject()));
	}
	return retval.toArray(new Relationship[retval.size()]);
}
 
Example 3
Source File: RdfModelObject.java    From tools with Apache License 2.0 6 votes vote down vote up
/**
 * Finds all SPDX elements with a subject of this object
 * @param namespace
 * @param propertyName
 * @return
 * @throws InvalidSPDXAnalysisException 
 */
protected SpdxElement[] findMultipleElementPropertyValues(String namespace,
		String propertyName) throws InvalidSPDXAnalysisException {
	if (this.model == null || this.node == null) {
		return null;
	}
	Node p = model.getProperty(namespace, propertyName).asNode();
	Triple m = Triple.createMatch(node, p, null);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
	List<SpdxElement> retval = Lists.newArrayList();
	while (tripleIter.hasNext()) {
		Triple t = tripleIter.next();
		retval.add(SpdxElementFactory.createElementFromModel(modelContainer, 
				t.getObject()));
	}
	return retval.toArray(new SpdxElement[retval.size()]);
}
 
Example 4
Source File: LicenseException.java    From tools with Apache License 2.0 6 votes vote down vote up
/**
 * Searches the model for a exception with the ID
 * @param model
 * @param id
 * @return Node containing the exception or Null if none found
 */
public static Node findException(Model model, String id) {
	Property idProperty = model.createProperty(SpdxRdfConstants.SPDX_NAMESPACE, 
			SpdxRdfConstants.PROP_LICENSE_EXCEPTION_ID);
	Property typeProperty = model.getProperty(SpdxRdfConstants.RDF_NAMESPACE, 
			SpdxRdfConstants.RDF_PROP_TYPE);
	Property exceptionTypeProperty = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE,
			SpdxRdfConstants.CLASS_SPDX_LICENSE_EXCEPTION);
	Triple m = Triple.createMatch(null, idProperty.asNode(), null);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
	while (tripleIter.hasNext()) {
		Triple t = tripleIter.next();
		if (t.getObject().toString(false).equals(id)) {
			Triple typeMatch = Triple.createMatch(t.getSubject(), typeProperty.asNode(), exceptionTypeProperty.asNode());
			ExtendedIterator<Triple> typeTripleIter = model.getGraph().find(typeMatch);
			if (typeTripleIter.hasNext()) {
				return t.getSubject();
			}
		}
	}
	return null;
}
 
Example 5
Source File: SPDXFile.java    From tools with Apache License 2.0 6 votes vote down vote up
/**
 * @return the sha1
 * @throws InvalidSPDXAnalysisException 
 */
public String getSha1()  {
	if (this.model != null && this.resource != null) {
		try {
			Node p = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_FILE_CHECKSUM).asNode();
			Triple m = Triple.createMatch(this.resource.asNode(), p, null);
			ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
			Triple t = null;
			while (tripleIter.hasNext()) {
				t = tripleIter.next();
				if (this.sha1 != null && nodesEquals(this.sha1.getResource().asNode(), t.getObject())) {
					break;
				}
			}
			if (this.sha1 == null || !nodesEquals(this.sha1.getResource().asNode(), t.getObject())) {
				this.sha1 = new SPDXChecksum(model, t.getObject());
			}
		} catch (InvalidSPDXAnalysisException e) {
			// just use the original sha1
		}
	}
	return this.sha1.getValue();
}
 
Example 6
Source File: RdfModelObject.java    From tools with Apache License 2.0 6 votes vote down vote up
/**
 * Find a single URI as a property value to this node
 * @param namespace
 * @param propertyName
 * @return
 */
protected String[] findUriPropertyValues(String namespace,
		String propertyName) {
	if (this.model == null || this.node == null) {
		return new String[0];
	}
	Node p = model.getProperty(namespace, propertyName).asNode();
	Triple m = Triple.createMatch(node, p, null);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
	List<String> retval = Lists.newArrayList();
	while (tripleIter.hasNext()) {
		Triple t = tripleIter.next();
		if (t.getObject().isURI()) {				
			retval.add(model.expandPrefix(t.getObject().getURI()));
		}
	}
	return retval.toArray(new String[retval.size()]);
}
 
Example 7
Source File: SpdxSnippet.java    From tools with Apache License 2.0 6 votes vote down vote up
@Override
public Resource findDuplicateResource(IModelContainer modelContainer, String uri) throws InvalidSPDXAnalysisException {
	if (this.snippetFromFile == null) {
		return null;
	}
	if (this.byteRange == null) {
		return null;
	}
	Resource snippetFromFileResource = SpdxFile.findFileResource(modelContainer, this.snippetFromFile);
	if (snippetFromFileResource == null) {
		return null;
	}
	Model model = modelContainer.getModel();
	Node snippetFromFileProperty = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_SNIPPET_FROM_FILE).asNode();
	Triple fileMatch = Triple.createMatch(null, snippetFromFileProperty, snippetFromFileResource.asNode());
	
	ExtendedIterator<Triple> fileMatchIter = model.getGraph().find(fileMatch);	
	while (fileMatchIter.hasNext()) {
		Triple fileMatchTriple = fileMatchIter.next();
		SpdxSnippet localSnippet = new SpdxSnippet(modelContainer, fileMatchTriple.getSubject());
		if (this.byteRange.equivalent(localSnippet.getByteRange())) {
			return model.asRDFNode(fileMatchTriple.getSubject()).asResource();
		}
	}
	return null;
}
 
Example 8
Source File: GroupConcatExpression.java    From shacl with Apache License 2.0 6 votes vote down vote up
@Override
public ExtendedIterator<RDFNode> eval(RDFNode focusNode, NodeExpressionContext context) {
	StringBuffer sb = new StringBuffer();
	ExtendedIterator<RDFNode> it = evalInput(focusNode, context);
	while(it.hasNext()) {
		RDFNode node = it.next();
		if(node.isLiteral() && XSDDatatype.XSDstring.getURI().equals(node.asNode().getLiteralDatatypeURI())) {
			sb.append(node.asNode().getLiteralLexicalForm());
		}
		else {
			String label = RDFLabels.get().getNodeLabel(node);
			if(label != null) {
				sb.append(label);
			}
		}
		if(separator != null && it.hasNext()) {
			sb.append(separator);
		}
	}
	List<RDFNode> results = Collections.singletonList(ResourceFactory.createTypedLiteral(sb.toString()));
	return WrappedIterator.create(results.iterator());
}
 
Example 9
Source File: SPDXDocument.java    From tools with Apache License 2.0 6 votes vote down vote up
/**
 * @return the spdxPackage
 * @throws InvalidSPDXAnalysisException 
 */
public SPDXPackage getSpdxPackage() throws InvalidSPDXAnalysisException {
	if (this.spdxPackage != null) {
		return this.spdxPackage;
	}
	Node spdxDocNode = getSpdxDocNode();
	if (spdxDocNode == null) {
		throw(new InvalidSPDXAnalysisException("Must set an SPDX doc before getting an SPDX package"));
	}
	Node p = model.getProperty(SPDX_NAMESPACE, PROP_SPDX_PACKAGE).asNode();
	Triple m = Triple.createMatch(spdxDocNode, p, null);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
	SPDXPackage newSpdxPackage = null;
	while (tripleIter.hasNext()) {
		Triple t = tripleIter.next();
		newSpdxPackage = new SPDXPackage(t.getObject(), this);
	}
	this.spdxPackage = newSpdxPackage;
	return newSpdxPackage;
}
 
Example 10
Source File: MaxExpression.java    From shacl with Apache License 2.0 6 votes vote down vote up
@Override
public ExtendedIterator<RDFNode> eval(RDFNode focusNode, NodeExpressionContext context) {
	RDFNode max = null;
	ExtendedIterator<RDFNode> it = evalInput(focusNode, context);
	while(it.hasNext()) {
		RDFNode next = it.next();
		if(max == null || NodeValue.compareAlways(NodeValue.makeNode(max.asNode()), NodeValue.makeNode(next.asNode())) < 0) {
			max = next;
		}
	}
	if(max == null) {
		return WrappedIterator.emptyIterator();
	}
	else {
		return WrappedIterator.create(Collections.singletonList(max).iterator());
	}
}
 
Example 11
Source File: CountExpression.java    From shacl with Apache License 2.0 5 votes vote down vote up
@Override
public ExtendedIterator<RDFNode> eval(RDFNode focusNode, NodeExpressionContext context) {
	int count = 0;
	ExtendedIterator<RDFNode> it = evalInput(focusNode, context);
	while(it.hasNext()) {
		it.next();
		count++;
	}
	List<RDFNode> results = Collections.singletonList(JenaDatatypes.createInteger(count));
	return WrappedIterator.create(results.iterator());
}
 
Example 12
Source File: SPDXFile.java    From tools with Apache License 2.0 5 votes vote down vote up
/**
 * @return the licenseComments
 */
public String getLicenseComments() {
	if (this.model != null && this.resource != null) {
		Node p = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LIC_COMMENTS).asNode();
		Triple m = Triple.createMatch(this.resource.asNode(), p, null);
		ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
		while (tripleIter.hasNext()) {
			Triple t = tripleIter.next();
			this.licenseComments = t.getObject().toString(false);
		}
	}
	return licenseComments;
}
 
Example 13
Source File: TestRdfModelObject.java    From tools with Apache License 2.0 5 votes vote down vote up
/**
 * Test method for {@link org.spdx.rdfparser.model.RdfModelObject#createResource(org.apache.jena.rdf.model.Model, java.lang.String)}.
 * @throws InvalidSPDXAnalysisException 
 */
@Test
public void testCreateResource() throws InvalidSPDXAnalysisException {
	final Model model = ModelFactory.createDefaultModel();
	IModelContainer modelContainer = new ModelContainerForTest(model, "http://testnamespace.com");
	EmptyRdfModelObject empty = new EmptyRdfModelObject();
	// Anon.
	String URI = "http://a/uri#r";
	empty.setUri(URI);
	Resource r = empty.createResource(modelContainer);
	assertTrue(r.isURIResource());
	Node p = model.getProperty(TEST_NAMESPACE, TEST_PROPNAME1).asNode();
	Triple m = Triple.createMatch(r.asNode(), p, null);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
	assertTrue(tripleIter.hasNext());
	Triple t = tripleIter.next();
	assertEquals(TEST_PROPVALUE1,t.getObject().toString(false));
	assertFalse(tripleIter.hasNext());
	// Anon
	empty.setUri(null);
	Resource anon = empty.createResource(modelContainer);
	assertFalse(anon.isURIResource());
	p = model.getProperty(TEST_NAMESPACE, TEST_PROPNAME1).asNode();
	m = Triple.createMatch(anon.asNode(), p, null);
	tripleIter = model.getGraph().find(m);	
	assertTrue(tripleIter.hasNext());
	t = tripleIter.next();
	assertEquals(TEST_PROPVALUE1,t.getObject().toString(false));
	assertFalse(tripleIter.hasNext());
}
 
Example 14
Source File: RdfModelObject.java    From tools with Apache License 2.0 5 votes vote down vote up
/**
 * @param nameSpace
 * @param propertyName
 * @return
 * @throws InvalidSPDXAnalysisException 
 */
protected SPDXCreatorInformation findCreationInfoPropertyValue(
		String nameSpace, String propertyName) throws InvalidSPDXAnalysisException {
	if (this.model == null || this.node == null) {
		return null;
	}
	Node p = model.getProperty(nameSpace, propertyName).asNode();
	Triple m = Triple.createMatch(node, p, null);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
	while (tripleIter.hasNext()) {
		Triple t = tripleIter.next();
		return new SPDXCreatorInformation(model, t.getObject());
	}
	return null;
}
 
Example 15
Source File: TestSpdxSnippet.java    From tools with Apache License 2.0 5 votes vote down vote up
/**
 * Test method for {@link org.spdx.rdfparser.model.SpdxSnippet#findDuplicateResource(org.spdx.rdfparser.IModelContainer, java.lang.String)}.
 * @throws InvalidSPDXAnalysisException 
 */
@Test
public void testFindDuplicateResource() throws InvalidSPDXAnalysisException {
	SpdxSnippet snippet = new SpdxSnippet("snippetName", null, null, null, 
			COMPLEX_LICENSE, NON_STD_LICENSES, SpdxRdfConstants.NOASSERTION_VALUE,
			null, FROM_FILE1, BYTE_RANGE1, LINE_RANGE1);
	Resource sr = snippet.createResource(modelContainer);
	
	Node byteRangeProperty = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_SNIPPET_RANGE).asNode();
	Triple byteRangeMatch = Triple.createMatch(null, byteRangeProperty, null);
	ExtendedIterator<Triple> byteRangeMatchIter = model.getGraph().find(byteRangeMatch);	
	int numByteRanges = 0;
	while (byteRangeMatchIter.hasNext()) {
		byteRangeMatchIter.next();
		numByteRanges++;
	}
	assertEquals(2, numByteRanges);
	SpdxSnippet clonedSnippet = snippet.clone();
	Resource sr2 = clonedSnippet.createResource(modelContainer);
	assertEquals(sr, sr2);

	byteRangeProperty = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_SNIPPET_RANGE).asNode();
	byteRangeMatch = Triple.createMatch(null, byteRangeProperty, null);
	byteRangeMatchIter = model.getGraph().find(byteRangeMatch);	
	numByteRanges = 0;
	while (byteRangeMatchIter.hasNext()) {
		byteRangeMatchIter.next();
		numByteRanges++;
	}
	assertEquals(2, numByteRanges);
}
 
Example 16
Source File: SPDXDocument.java    From tools with Apache License 2.0 5 votes vote down vote up
/**
 * @return the spdx doc node from the model
 */
private Node getSpdxDocNode() {
	Node spdxDocNode = null;
	Node rdfTypePredicate = this.model.getProperty(RDF_NAMESPACE, RDF_PROP_TYPE).asNode();
	Node spdxDocObject = this.model.getProperty(SPDX_NAMESPACE, CLASS_SPDX_ANALYSIS).asNode();
	Triple m = Triple.createMatch(null, rdfTypePredicate, spdxDocObject);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	// find the document
	while (tripleIter.hasNext()) {
		Triple docTriple = tripleIter.next();
		spdxDocNode = docTriple.getSubject();
	}
	return spdxDocNode;
}
 
Example 17
Source File: LicenseSet.java    From tools with Apache License 2.0 5 votes vote down vote up
/**
 * @param modelContainer container which includes the license
 * @param licenseInfoNode Node in the RDF model which defines the licenseSet
 * @throws InvalidSPDXAnalysisException 
 */
public LicenseSet(IModelContainer modelContainer, Node licenseInfoNode) throws InvalidSPDXAnalysisException {
	super(modelContainer, licenseInfoNode);
	Node p = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_LICENSE_SET_MEMEBER).asNode();
	Triple m = Triple.createMatch(licenseInfoNode, p, null);
	ExtendedIterator<Triple> tripleIter = model.getGraph().find(m);	
	while (tripleIter.hasNext()) {
		Triple t = tripleIter.next();
		this.licenseInfos.add(LicenseInfoFactory.getLicenseInfoFromModel(modelContainer, t.getObject()));
	}
}
 
Example 18
Source File: SPDXChecksum.java    From tools with Apache License 2.0 5 votes vote down vote up
protected static Resource findSpdxChecksum(Model model, SPDXChecksum checksum) throws InvalidSPDXAnalysisException {
	// find any matching checksum values
	Node checksumValueProperty = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_CHECKSUM_VALUE).asNode();
	Triple checksumValueMatch = Triple.createMatch(null, checksumValueProperty, NodeFactory.createLiteral(checksum.getValue()));
	ExtendedIterator<Triple> checksumMatchIter = model.getGraph().find(checksumValueMatch);	
	while (checksumMatchIter.hasNext()) {
		Triple checksumMatchTriple = checksumMatchIter.next();
		Node checksumNode = checksumMatchTriple.getSubject();
		// check the algorithm
		Node algorithmProperty = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_CHECKSUM_ALGORITHM).asNode();
		Triple algorithmMatch = Triple.createMatch(checksumNode, algorithmProperty, null);
		ExtendedIterator<Triple> algorithmMatchIterator = model.getGraph().find(algorithmMatch);
		if (algorithmMatchIterator.hasNext()) {
			String algorithm = "UNKNOWN";
			Triple algorithmMatchTriple = algorithmMatchIterator.next();
			if (algorithmMatchTriple.getObject().isLiteral()) {
				// The following is for compatibility with rdf generated with older
				// versions of the tool
				algorithm = algorithmMatchTriple.getObject().toString(false);
			} else if (algorithmMatchTriple.getObject().isURI()) {
				algorithm = URI_TO_ALGORITHM.get(algorithmMatchTriple.getObject().getURI());
				if (algorithm == null) {
					algorithm = "UNKNOWN";
				}
			}
			if (algorithm.equals(checksum.getAlgorithm())) {
				return RdfParserHelper.convertToResource(model, checksumNode);
			}
		}
	}
	// if we get to here, we did not find a match
	return null;
}
 
Example 19
Source File: SpdxFile.java    From tools with Apache License 2.0 5 votes vote down vote up
/**
 * Finds the resource for an existing file in the model
 * @param spdxFile
 * @return resource of an SPDX file with the same name and checksum.  Null if none found
 * @throws InvalidSPDXAnalysisException 
 */
static protected Resource findFileResource(IModelContainer modelContainer, SpdxFile spdxFile) throws InvalidSPDXAnalysisException {
	// find any matching file names
	Model model = modelContainer.getModel();
	Node fileNameProperty = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_FILE_NAME).asNode();
	if (spdxFile.getName() == null) {
		return null;	// Can't match without a name
	}
	Triple fileNameMatch = Triple.createMatch(null, fileNameProperty, NodeFactory.createLiteral(spdxFile.getName()));
	
	ExtendedIterator<Triple> filenameMatchIter = model.getGraph().find(fileNameMatch);	
	if (filenameMatchIter.hasNext()) {
		Triple fileMatchTriple = filenameMatchIter.next();
		Node fileNode = fileMatchTriple.getSubject();
		// check the checksum
		Node checksumProperty = model.getProperty(SpdxRdfConstants.SPDX_NAMESPACE, SpdxRdfConstants.PROP_FILE_CHECKSUM).asNode();
		Triple checksumMatch = Triple.createMatch(fileNode, checksumProperty, null);
		ExtendedIterator<Triple> checksumMatchIterator = model.getGraph().find(checksumMatch);
		if (checksumMatchIterator.hasNext()) {
			Triple checksumMatchTriple = checksumMatchIterator.next();
			Checksum cksum = new Checksum(modelContainer, checksumMatchTriple.getObject());
			if (cksum.getAlgorithm().equals(ChecksumAlgorithm.checksumAlgorithm_sha1) &&
					cksum.getValue().compareToIgnoreCase(spdxFile.getSha1()) == 0) {
				return RdfParserHelper.convertToResource(model, fileNode);
			}
		}
	}
	// if we get to here, we did not find a match
	return null;
}
 
Example 20
Source File: LicenseInfoFactory.java    From tools with Apache License 2.0 4 votes vote down vote up
/**
 * @param modelContainer
 * @param node
 * @return
 * @throws InvalidSPDXAnalysisException 
 */
private static AnyLicenseInfo getLicenseInfoByType(IModelContainer modelContainer, Node node) throws InvalidSPDXAnalysisException {
	// find the subclass
	Node rdfTypePredicate = modelContainer.getModel().getProperty(SpdxRdfConstants.RDF_NAMESPACE, 
			SpdxRdfConstants.RDF_PROP_TYPE).asNode();
	Triple m = Triple.createMatch(node, rdfTypePredicate, null);
	ExtendedIterator<Triple> tripleIter = modelContainer.getModel().getGraph().find(m);	// find the type(s)
	if (tripleIter.hasNext()) {
		Triple triple = tripleIter.next();
		if (tripleIter.hasNext()) {
			throw(new InvalidSPDXAnalysisException("More than one type associated with a licenseInfo"));
		}
		Node typeNode = triple.getObject();
		if (!typeNode.isURI()) {
			throw(new InvalidSPDXAnalysisException("Invalid type for licenseInfo - not a URI"));
		}
		// need to parse the URI
		String typeUri = typeNode.getURI();
		if (!typeUri.startsWith(SpdxRdfConstants.SPDX_NAMESPACE)) {
			throw(new InvalidSPDXAnalysisException("Invalid type for licenseInfo - not an SPDX type"));
		}
		String type = typeUri.substring(SpdxRdfConstants.SPDX_NAMESPACE.length());
		if (type.equals(SpdxRdfConstants.CLASS_SPDX_CONJUNCTIVE_LICENSE_SET)) {
			return new ConjunctiveLicenseSet(modelContainer, node);
		} else if (type.equals(SpdxRdfConstants.CLASS_SPDX_DISJUNCTIVE_LICENSE_SET)) {
			return new DisjunctiveLicenseSet(modelContainer, node);
		} else if (type.equals(SpdxRdfConstants.CLASS_SPDX_EXTRACTED_LICENSING_INFO)) {
			return new ExtractedLicenseInfo(modelContainer, node);
		} else if (type.equals(SpdxRdfConstants.CLASS_SPDX_LICENSE)) {
			return new SpdxListedLicense(modelContainer, node);
		} else if (type.equals(SpdxRdfConstants.CLASS_OR_LATER_OPERATOR)) {
			return new OrLaterOperator(modelContainer, node);
		} else if (type.equals(SpdxRdfConstants.CLASS_WITH_EXCEPTION_OPERATOR)) {
			return new WithExceptionOperator(modelContainer, node);
		} else {
			throw(new InvalidSPDXAnalysisException("Invalid type for licenseInfo '"+type+"'"));
		}
	} else {
		return null;
	}
}