All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aksw.jena_sparql_api.views.Prefix Maven / Gradle / Ivy

There is a newer version: 3.17.0-1
Show newest version
package org.aksw.jena_sparql_api.views;

public class Prefix {
	private String prefix;
	
	// Whether the prefix is actually the constant itself (i.e. a single element set)
	private boolean isConstant;

	public Prefix(String prefix) {
		this(prefix, false);
	}

	public Prefix(String prefix, boolean isConstant) {
		this.prefix = prefix;
		this.isConstant = isConstant;
	}
	
	public String getPrefix() {
		return prefix;
	}
	
	public boolean isConstant() {
		return isConstant;
	}
	
	public boolean isPrefixOf(Prefix that) {
		boolean result;
		if(this.isConstant) {
			result = that.isConstant && that.prefix.equals(this.prefix);
		} else {
			result = that.prefix.startsWith(this.prefix);
		}
		
		return result;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy