hydra.langs.rdf.syntax.Property Maven / Gradle / Ivy
package hydra.langs.rdf.syntax;
import java.io.Serializable;
/**
* A type representing an RDF property, and encapsulating its domain, range, and subclass relationships
*/
public class Property implements Serializable {
public static final hydra.core.Name NAME = new hydra.core.Name("hydra/langs/rdf/syntax.Property");
/**
* State that any resource that has a given property is an instance of one or more classes
*/
public final java.util.Set domain;
/**
* States that the values of a property are instances of one or more classes
*/
public final java.util.Set range;
public final java.util.Set subPropertyOf;
public Property (java.util.Set domain, java.util.Set range, java.util.Set subPropertyOf) {
this.domain = domain;
this.range = range;
this.subPropertyOf = subPropertyOf;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Property)) {
return false;
}
Property o = (Property) (other);
return domain.equals(o.domain) && range.equals(o.range) && subPropertyOf.equals(o.subPropertyOf);
}
@Override
public int hashCode() {
return 2 * domain.hashCode() + 3 * range.hashCode() + 5 * subPropertyOf.hashCode();
}
public Property withDomain(java.util.Set domain) {
return new Property(domain, range, subPropertyOf);
}
public Property withRange(java.util.Set range) {
return new Property(domain, range, subPropertyOf);
}
public Property withSubPropertyOf(java.util.Set subPropertyOf) {
return new Property(domain, range, subPropertyOf);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy