public class PrefixSet extends Object
| Constructor and Description |
|---|
PrefixSet(Prefix value) |
PrefixSet(Prefix value,
Polarity polarity) |
PrefixSet(Prefix value,
Polarity polarity,
Set<PrefixSet> exceptions) |
| Modifier and Type | Method and Description |
|---|---|
PrefixSet |
addException(Prefix exception)
Adds an exception to the current set.
|
void |
addException(PrefixSet that)
Adds an exception:
Example:
prefix = {owl}
addException(owla)
addException(owlab)
|
boolean |
contains(Prefix that) |
boolean |
contains(String str) |
PrefixSet |
getExceptionFor(Prefix prefix) |
Set<PrefixSet> |
getExceptions() |
Set<PrefixSet> |
getExceptions(String prefix)
Returns the set of exceptions with the given prefix
|
Polarity |
getPolarity() |
Set<PrefixSet> |
getSuffixExceptions(Prefix prefix) |
Prefix |
getValue() |
static Prefix |
intersect(Prefix a,
Prefix b) |
static String |
intersect(String a,
String b) |
PrefixSet |
intersects(PrefixSet that)
How to deal with exceptions:
- This is not owl, except for owl:Class
- This is rdf, except for rdf:type
case: positive - positive
Create the intersection:
{owl} and {rdf} -> {}
{owl} and {owla} -> {owla} (owla is more specific)
case: positive - negative
{owl} and not{owla, rdf} -> {owl} except {owla} (positive prevails)
{owl} and not{owla} -> {owl[except owla]} (exception)}
not{owla} and {owl} -> same as above
not{owl} and {owla} -> {} (owl namespace was excluded)
case: negative - negative
Create the union:
not{owl} and not{rdf} -> not{rdf, owl}
not(owl} and not{owla} -> not{owl} (owla subsumed by the shorter prefix)
|
boolean |
isPrefixOf(String str) |
PrefixSet |
negate() |
PrefixSet |
union(PrefixSet that)
Rule of thumb: Shorter prefixes subsume longer ones
{owl} union {owla} -> {owl}
The exceptions are then also unioned:
for each exception it is checked, whether there is a shorter exception
case: positive - positive
{owl} union {rdf} -> {} except {owl, rdf}
{owl} union {owla} -> {owl}
case: positive - negative
{owl} union not{owla, rdf} -> {} except {owl, rdf}
{owl} union not{owla} -> {owl[except owla]} (exception)}
not{owla} and {owl} -> same as above
not{owl} and {owla} -> {} (owl namespace was excluded)
case: negative - negative
Create the union:
not{owl} union not{rdf} -> not{rdf, owl}
not(owl} and not{owla} -> not{owl} (owla subsumed by the shorter prefix)
|
public PrefixSet(Prefix value)
public Polarity getPolarity()
public Prefix getValue()
public boolean isPrefixOf(String str)
public boolean contains(String str)
public boolean contains(Prefix that)
public PrefixSet addException(Prefix exception)
exception - public void addException(PrefixSet that)
exception - public Set<PrefixSet> getExceptions(String prefix)
prefix - public PrefixSet intersects(PrefixSet that)
public PrefixSet union(PrefixSet that)
that - public PrefixSet negate()
Copyright © 2014. All Rights Reserved.