org.openrdf.model.vocabulary.OWL Java Examples

The following examples show how to use org.openrdf.model.vocabulary.OWL. 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: QueryService.java    From anno4j with Apache License 2.0 6 votes vote down vote up
public <T> QueryService(ObjectConnection connection, LDPathEvaluatorConfiguration evaluatorConfiguration) {
    this.connection = connection;

    this.queryServiceDTO = new QueryServiceConfiguration();
    queryServiceDTO.setEvaluatorConfiguration(evaluatorConfiguration);
    queryServiceDTO.setConfiguration(createLDPathConfiguration());

    this.queryOptimizer = QueryOptimizer.getInstance();

    // Setting some common name spaces
    addPrefix(OADM.PREFIX, OADM.NS);
    addPrefix(CNT.PREFIX, CNT.NS);
    addPrefix(DC.PREFIX, DC.NS);
    addPrefix(DCTERMS.PREFIX, DCTERMS.NS);
    addPrefix(DCTYPES.PREFIX, DCTYPES.NS);
    addPrefix(FOAF.PREFIX, FOAF.NS);
    addPrefix(PROV.PREFIX, PROV.NS);
    addPrefix(RDF.PREFIX, RDF.NS);
    addPrefix(OWL.PREFIX, OWL.NAMESPACE);
    addPrefix(RDFS.PREFIX, RDFS.NAMESPACE);
    addPrefix(SKOS.PREFIX, SKOS.NAMESPACE);
}
 
Example #2
Source File: EntityTypeSerializer.java    From attic-polygene-java with Apache License 2.0 6 votes vote down vote up
public Iterable<Statement> serialize( final EntityDescriptor entityDescriptor )
{
    Graph graph = new GraphImpl();
    ValueFactory values = graph.getValueFactory();
    URI entityTypeUri = values.createURI( Classes.toURI( entityDescriptor.types().findFirst().orElse( null ) ) );

    graph.add( entityTypeUri, Rdfs.TYPE, Rdfs.CLASS );
    graph.add( entityTypeUri, Rdfs.TYPE, OWL.CLASS );

    graph.add( entityTypeUri,
               PolygeneEntityType.TYPE,
               values.createLiteral( entityDescriptor.types().findFirst().get().toString() )
    );
    graph.add( entityTypeUri, PolygeneEntityType.QUERYABLE, values.createLiteral( entityDescriptor.queryable() ) );

    serializeMixinTypes( entityDescriptor, graph, entityTypeUri );

    serializePropertyTypes( entityDescriptor, graph, entityTypeUri );
    serializeAssociationTypes( entityDescriptor, graph, entityTypeUri );
    serializeManyAssociationTypes( entityDescriptor, graph, entityTypeUri );

    return graph;
}
 
Example #3
Source File: JavaMessageBuilder.java    From anno4j with Apache License 2.0 6 votes vote down vote up
private String getMessageName(RDFClass msg) {
	List<? extends Value> list = msg.getList(OWL.INTERSECTIONOF);
	if (list != null) {
		for (Value value : list) {
			if (value instanceof URI) {
				RDFClass rc = new RDFClass(msg.getModel(), (URI) value);
				if (rc.isMessageClass()) {
					String name = getMessageName(rc);
					if (name != null)
						return name;
				}
			}
		}
	}
	if (resolver.isAnonymous(msg.getURI()))
		return null;
	return resolver.getMethodName(msg.getURI());
}
 
Example #4
Source File: RuleOwlTransitiveProperty1.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlTransitiveProperty1(String relationName, Vocabulary vocab) {

    super(  "owlTransitiveProperty1",//
            new SPOPredicate(relationName,var("x"), var("a"), var("z")), //
            new SPOPredicate[] { //
                new SPOPredicate(relationName,var("a"), vocab.getConstant(RDF.TYPE), vocab.getConstant(OWL.TRANSITIVEPROPERTY)),//
                new SPOPredicate(relationName,var("x"), var("a"), var("y")),//
                new SPOPredicate(relationName,var("y"), var("a"), var("z"))//
            }, new IConstraint[] {
    			Constraint.wrap(new NE(var("x"),var("y"))),
    			Constraint.wrap(new NE(var("y"),var("z"))),
	Constraint.wrap(new NE(var("x"),var("z"))),
                }
            );
    
}
 
Example #5
Source File: RDFClass.java    From anno4j with Apache License 2.0 6 votes vote down vote up
private void interfaceHeader(JavaMessageBuilder builder)
		throws ObjectStoreConfigException {
	String pkg = builder.getPackageName(this.getURI());
	String simple = builder.getSimpleName(this.getURI());
	if (pkg == null) {
		builder.imports(simple);
	} else {
		builder.pkg(pkg);
		builder.imports(pkg + '.' + simple);
	}
	builder.comment(this);
	if (this.isA(OWL.DEPRECATEDCLASS)) {
		builder.annotate(Deprecated.class);
	}
	builder.annotationProperties(this);
	if (!builder.isAnonymous(this.getURI())) {
		builder.annotateURI(Iri.class, "value", builder.getType(this.getURI()));
	}
	builder.interfaceName(simple);
	for (RDFClass sups : this.getRDFClasses(RDFS.SUBCLASSOF)) {
		if (sups.getURI() == null || sups.equals(this))
			continue;
		builder.extend(builder.getClassName(sups.getURI()));
	}
}
 
Example #6
Source File: RuleOwlSameAs2.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
     * @param vocab
     */
    public RuleOwlSameAs2(String relationName, Vocabulary vocab) {

        super(  "owlSameAs2",//
                new SPOPredicate(relationName,var("y"), var("a"), var("z")), //
                new SPOPredicate[] { //
                    new SPOPredicate(relationName,var("x"), vocab.getConstant(OWL.SAMEAS), var("y")),//
                    new SPOPredicate(relationName,var("x"), var("a"), var("z"))//
                },
                new IConstraint[]{
                    /*
                     * Reject (y sameAs z) as the head.
                     */
//                    new RejectAnythingSameAsItself(var("y"),var("a"),var("z"),vocab.getConstant(OWL.SAMEAS))
        			Constraint.wrap(new NEConstant(var("a"),vocab.getConstant(OWL.SAMEAS))),
        			Constraint.wrap(new NE(var("x"),var("y")))
                }
        );
       
    }
 
Example #7
Source File: RuleOwlSameAs1b.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlSameAs1b(String relationName, Vocabulary vocab) {

    super(  "owlSameAs1b",//
            new SPOPredicate(relationName,var("x"), vocab.getConstant(OWL.SAMEAS), var("z")), //
            new SPOPredicate[] { //
                new SPOPredicate(relationName,var("x"), vocab.getConstant(OWL.SAMEAS), var("y")),//
                new SPOPredicate(relationName,var("y"), vocab.getConstant(OWL.SAMEAS), var("z"))//
            }, new IConstraint[] {
    			Constraint.wrap(new NE(var("x"),var("y"))),
    			Constraint.wrap(new NE(var("y"),var("z"))),
	Constraint.wrap(new NE(var("x"),var("z"))),
                }
            );
    
}
 
Example #8
Source File: RDFClass.java    From anno4j with Apache License 2.0 6 votes vote down vote up
public Collection<RDFClass> getDeclaredMessages() {
	Set<RDFClass> set = new TreeSet<RDFClass>();
	for (Resource res : model.filter(null, OWL.ALLVALUESFROM, self)
			.subjects()) {
		if (model.contains(res, OWL.ONPROPERTY, MSG.TARGET)) {
			for (Resource msg : model.filter(null, RDFS.SUBCLASSOF, res)
					.subjects()) {
				if (MSG.MESSAGE.equals(msg))
					continue;
				RDFClass rc = new RDFClass(model, msg);
				if (rc.isMessageClass()) {
					set.add(rc);
				}
			}
		}
	}
	return set;
}
 
Example #9
Source File: RDFClass.java    From anno4j with Apache License 2.0 6 votes vote down vote up
public boolean isMinCardinality(RDFProperty property) {
	BigInteger one = BigInteger.valueOf(1);
	for (RDFClass c : getRDFClasses(RDFS.SUBCLASSOF)) {
		if (c.isA(OWL.RESTRICTION)) {
			if (property.equals(c.getRDFProperty(OWL.ONPROPERTY))) {
				if (one.equals(c.getBigInteger(OWL.MAXCARDINALITY))
						&& one.equals(c.getBigInteger(OWL.MINCARDINALITY))
						|| one.equals(c.getBigInteger(OWL.CARDINALITY))) {
					return true;
				}
			}
		} else if (equals(c)) {
			continue;
		} else if (c.isMinCardinality(property)) {
			return true;
		}
	}
	return false;
}
 
Example #10
Source File: RuleOwlInverseFunctionalProperty.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlInverseFunctionalProperty(String relationName, Vocabulary vocab) {

    super( "owlInverseFunctionalProperty", //
            new SPOPredicate(relationName,var("b"), vocab.getConstant(OWL.SAMEAS), var("c")),//
            new SPOPredicate[] {//
                new SPOPredicate(relationName,var("x"), vocab.getConstant(RDF.TYPE), vocab.getConstant(OWL.INVERSEFUNCTIONALPROPERTY)),//
                new SPOPredicate(relationName,var("b"), var("x"), var("a")),//
                new SPOPredicate(relationName,var("c"), var("x"), var("a"))//
            },
            new IConstraint[] {
	Constraint.wrap(new NE(var("b"),var("c")))
      }
            );
    
}
 
Example #11
Source File: RuleOwlSameAs3.java    From database with GNU General Public License v2.0 6 votes vote down vote up
public RuleOwlSameAs3(String relationName, Vocabulary vocab) {

        super(  "owlSameAs3", //
                new SPOPredicate(relationName,var("z"), var("a"), var("y")), //
                new SPOPredicate[] { //
                    new SPOPredicate(relationName,var("x"), vocab.getConstant(OWL.SAMEAS), var("y")),//
                    new SPOPredicate(relationName,var("z"), var("a"), var("x"))//
                },
                new IConstraint[] {
                    /*
                     * Reject (z sameAs y) as the head.
                     */
//                    new RejectAnythingSameAsItself(var("z"),var("a"),var("y"),vocab.getConstant(OWL.SAMEAS))
        			Constraint.wrap(new NEConstant(var("a"),vocab.getConstant(OWL.SAMEAS))),
        			Constraint.wrap(new NE(var("x"),var("y")))
                }
        );

    }
 
Example #12
Source File: RuleOwlHasValue.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlHasValue(String relationName, Vocabulary vocab) {


    super(  "owl:hasValue",//
            new SPOPredicate(relationName, var("x"), var("p"), var("v")), //
            new SPOPredicate[] { //
                new SPOPredicate(relationName,var("x"), vocab.getConstant(RDF.TYPE), var("a")),//
                new SPOPredicate(relationName,var("a"), vocab.getConstant(RDF.TYPE), vocab.getConstant(OWL.RESTRICTION)),//
                new SPOPredicate(relationName,var("a"), vocab.getConstant(OWL.ONPROPERTY), var("p")),//
                new SPOPredicate(relationName,var("a"), vocab.getConstant(OWL.HASVALUE), var("v"))//
            },//
            null//constraints
            );
    
}
 
Example #13
Source File: RuleOwlFunctionalProperty.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlFunctionalProperty(String relationName, Vocabulary vocab) {

    super( "owlFunctionalProperty", //
            new SPOPredicate(relationName,var("b"), vocab.getConstant(OWL.SAMEAS), var("c")),//
            new SPOPredicate[] {//
                new SPOPredicate(relationName,var("x"), vocab.getConstant(RDF.TYPE), vocab.getConstant(OWL.FUNCTIONALPROPERTY)),//
                new SPOPredicate(relationName,var("a"), var("x"), var("b")),//
                new SPOPredicate(relationName,var("a"), var("x"), var("c"))//
            },
            new IConstraint[] {
	Constraint.wrap(new NE(var("b"),var("c")))
      }
            );
    
}
 
Example #14
Source File: OwlNormalizer.java    From anno4j with Apache License 2.0 6 votes vote down vote up
private void checkPropertyDomains() {
	loop: for (Statement st : ds.match(null, RDF.TYPE, RDF.PROPERTY)) {
		Resource p = st.getSubject();
		if (!ds.contains(p, RDFS.DOMAIN, null)) {
			for (Value sup : ds.match(p, RDFS.SUBPROPERTYOF, null).objects()) {
				for (Value obj : ds.match(sup, RDFS.DOMAIN, null).objects()) {
					ds.add(p, RDFS.DOMAIN, obj);
					continue loop;
				}
			}
			ds.add(p, RDFS.DOMAIN, RDFS.RESOURCE);
			if (!ds.contains(RDFS.RESOURCE, RDF.TYPE, OWL.CLASS)) {
				ds.add(RDFS.RESOURCE, RDF.TYPE, OWL.CLASS);
			}
		}
	}
}
 
Example #15
Source File: KnownURIsDictionaryTest.java    From cumulusrdf with Apache License 2.0 6 votes vote down vote up
/**
 * Tests remove() method with managed URI.
 * 
 * @throws Exception never otherwise the test fails.
 */
@Test
public void removeManagedURI() throws Exception {
	final String[] managedNamespaces = {
			FOAF.NAMESPACE,
			RDFS.NAMESPACE,
			OWL.NAMESPACE };

	for (final String managedNamespace : managedNamespaces) {
		assertTrue(_cut.contains(managedNamespace));

		final Value uri = buildResource(managedNamespace + randomString());
		final String n3 = NTriplesUtil.toNTriplesString(uri);

		_cut.removeValue(uri, _isPredicate);
		verify(_dummyIndex).remove(n3);

		reset(_dummyIndex);
	}
}
 
Example #16
Source File: RDFClass.java    From anno4j with Apache License 2.0 5 votes vote down vote up
protected boolean isFunctionalProperty(RDFProperty property) {
	if (property.isA(OWL.FUNCTIONALPROPERTY))
		return true;
	URI uri = property.getURI();
	if (uri.equals(MSG.TARGET)
			|| uri.equals(MSG.LITERAL)
			|| uri.equals(MSG.OBJECT))
		return true;
	return false;
}
 
Example #17
Source File: RuleOwlSymmetricProperty.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlSymmetricProperty(String relationName, Vocabulary vocab) {

    super( "owlSymmetricProperty", //
            new SPOPredicate(relationName,var("b"), var("x"), var("a")),//
            new SPOPredicate[] {//
                new SPOPredicate(relationName,var("x"), vocab.getConstant(RDF.TYPE), vocab.getConstant(OWL.SYMMETRICPROPERTY)),//
                new SPOPredicate(relationName,var("a"), var("x"), var("b"))//
            },
            new IConstraint[] {
	Constraint.wrap(new NE(var("a"),var("b")))
      }
            );
    
}
 
Example #18
Source File: RDFClass.java    From anno4j with Apache License 2.0 5 votes vote down vote up
private void constants(JavaMessageBuilder builder) {
	List<? extends Value> oneOf = this.getList(OWL.ONEOF);
	if (oneOf != null) {
		Map<String, URI> names = new LinkedHashMap<String, URI>();
		for (Value one : oneOf) {
			if (one instanceof URI) {
				URI uri = (URI) one;
				String localPart = uri.getLocalName();
				if (localPart.length() < 1) {
					localPart = uri.stringValue();
				}
				String name = localPart.replaceAll("^[^a-zA-Z]", "_")
						.replaceAll("\\W+", "_");
				if (names.containsKey(name)) {
					int count = 1;
					while (names.containsKey(name + '_' + count)) {
						count++;
					}
					name = name + '_' + count;
				}
				names.put(name, uri);
			}
		}
		if (!names.isEmpty()) {
			names = toUpperCase(names);
			for (Map.Entry<String, URI> e : names.entrySet()) {
				builder.staticURIField(e.getKey(), e.getValue());
			}
			if (!names.containsKey("ONEOF")) {
				builder.staticURIArrayField("ONEOF", names.keySet());
			}
		}
	}
}
 
Example #19
Source File: RDFClass.java    From anno4j with Apache License 2.0 5 votes vote down vote up
public Collection<RDFClass> getRestrictions() {
	Collection<RDFClass> restrictions = new LinkedHashSet<RDFClass>();
	for (RDFClass c : getRDFClasses(RDFS.SUBCLASSOF)) {
		if (c.isA(OWL.RESTRICTION)) {
			restrictions.add(c);
		} else if (equals(c)) {
			continue;
		} else {
			restrictions.addAll(c.getRestrictions());
		}
	}
	return restrictions;
}
 
Example #20
Source File: RepositoryConnectionTest.java    From database with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void testTransactionIsolationForRead()
	throws Exception
{
	testCon.begin();
	try {
		// Add but do not commit
		testCon.add(OWL.CLASS, RDFS.COMMENT, RDF.STATEMENT);
		assertTrue("Should be able to see uncommitted statement on same connection",
				testCon.hasStatement(OWL.CLASS, RDFS.COMMENT, RDF.STATEMENT, true));

		assertFalse(
				"Should not be able to see uncommitted statement on separate connection outside transaction",
				testCon2.hasStatement(OWL.CLASS, RDFS.COMMENT, RDF.STATEMENT, true));

		testCon2.begin();
		try {
			assertFalse(
					"Should not be able to see uncommitted statement on separate connection inside transaction",
					testCon2.hasStatement(OWL.CLASS, RDFS.COMMENT, RDF.STATEMENT, true));
		}
		finally {
			testCon2.rollback();
		}

	}
	finally {
		testCon.rollback();
	}

}
 
Example #21
Source File: ClassComposer.java    From anno4j with Apache License 2.0 5 votes vote down vote up
private List<Method> getEquivalentMethods(Method method) {
	List<Method> list = new ArrayList<Method>();
	String equivalentClass = OWL.EQUIVALENTCLASS.stringValue();
	for (String uri : getAnnotationValueByIri(method, equivalentClass)) {
		Method m = namedMethods.get(uri);
		if (m != null && !isSpecial(m)) {
			list.add(m);
		}
	}
	return list;
}
 
Example #22
Source File: PrefixDeclProcessor.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
       * Provide silent declaration for some well known namspaces.
       */
      @SuppressWarnings("unused")
private String checkForWellKnownNamespacePrefix(final String prefix) {
          final String namespace;
          if (prefix.equals("bd")) {
              prefixMap.put("bd", namespace = BD.NAMESPACE);
          } else if (prefix.equals("bds")) {
              prefixMap.put("bds", namespace = BDS.NAMESPACE);
          } else if (prefix.equals("hint")) {
              prefixMap.put("hint", namespace = QueryHints.NAMESPACE);
          } else if (prefix.equals("rdf")) {
              prefixMap.put("rdf", namespace = RDF.NAMESPACE);
          } else if (prefix.equals("rdfs")) {
              prefixMap.put("rdfs", namespace = RDFS.NAMESPACE);
          } else if (prefix.equals("xsd")) {
              prefixMap.put("xsd", namespace = XSD.NAMESPACE);
          } else if (prefix.equals("foaf")) {
              prefixMap.put("foaf", namespace = FOAFVocabularyDecl.NAMESPACE);
          } else if (prefix.equals("fn")) { // XPath Functions.
              prefixMap.put("fn", namespace = FN.NAMESPACE);
          } else if (prefix.equals("owl")) {
              prefixMap.put("owl", namespace = OWL.NAMESPACE);
          } else if (prefix.equals("sesame")) {
              prefixMap.put("sesame", namespace = SESAME.NAMESPACE);
          } else if (prefix.equals("gas")) {
              prefixMap.put("gas", namespace = GASService.Options.NAMESPACE);
          } else {
              // Unknown
              namespace = null;
          }
          return namespace;
      }
 
Example #23
Source File: OWLOntologySkin.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a list of defined OWLClasses.  The classes do not
 * in fact have any reference to the Ontology instance, but the
 * skin supports the fiction.
 */
public Iterator<OWLClassSkin> getClasses() {
	final IObjectManager om = m_gpo.getObjectManager();
	
	final IGPO classClass = om.getGPO(OWL.CLASS);
	
	final Iterator<IGPO> owlClasses = classClass.getLinksIn(RDF.TYPE).iterator();
	
	return new Iterator<OWLClassSkin>() {

		@Override
		public boolean hasNext() {
			return owlClasses.hasNext();
		}

		@Override
		public OWLClassSkin next() {
			IGPO nxt = owlClasses.next();
			return (OWLClassSkin) ((GPO) nxt).getSkin(OWLClassSkin.class);
		}

		@Override
		public void remove() {
			throw new UnsupportedOperationException();
		}
		
	};		
}
 
Example #24
Source File: RuleOwlSameAs1.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlSameAs1(String relationName, Vocabulary vocab) {

    super(  "owlSameAs1",//
            new SPOPredicate(relationName,var("y"), vocab.getConstant(OWL.SAMEAS), var("x")), //
            new SPOPredicate[] { //
                new SPOPredicate(relationName,var("x"), vocab.getConstant(OWL.SAMEAS), var("y"))//
            },
            new IConstraint[] {
    			Constraint.wrap(new NE(var("x"),var("y")))
            }
            );
    
}
 
Example #25
Source File: KnownURIsDictionaryTest.java    From cumulusrdf with Apache License 2.0 5 votes vote down vote up
/**
 * A request is received for a URI with a namespace that belongs to managed domains. 
 * 
 * @throws Exception never otherwise the test fails.
 */
@Test
public void getIdWithManagedURI() throws Exception {
	final String[] managedNamespaces = {
			FOAF.NAMESPACE,
			RDFS.NAMESPACE,
			OWL.NAMESPACE
	};

	for (final String managedNamespace : managedNamespaces) {
		assertTrue(_cut.contains(managedNamespace));

		final Value uri = buildResource(managedNamespace + randomString());

		final String n3 = NTriplesUtil.toNTriplesString(uri);

		// Make sure the mock index returns "Sorry, we don't have such value".
		when(_dummyIndex.get(n3)).thenReturn(ValueDictionaryBase.NOT_SET);

		// 1. ask for uri.
		byte[] id = _cut.getID(uri, _isPredicate);

		// 2. make sure the identifier is well-formed.
		assertEquals(KnownURIsDictionary.ID_LENGTH, id.length);
		assertEquals(KnownURIsDictionary.KNOWN_URI_MARKER, id[0]);
		assertEquals(ValueDictionaryBase.RESOURCE_BYTE_FLAG, id[1]);

		// 3. make sure the decoratee wasn't involved in identifier creation.
		verify(_decoratee, times(0)).getID(uri, _isPredicate);
		verify(_dummyIndex).putQuick(n3, id);

		reset(_decoratee, _dummyIndex);
	}
}
 
Example #26
Source File: RuleOwlInverseOf2.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlInverseOf2(String relationName, Vocabulary vocab) {

    super( "owlInverseOf2", //
            new SPOPredicate(relationName,var("v"), var("b"), var("u")),//
            new SPOPredicate[] {//
                new SPOPredicate(relationName,var("a"), vocab.getConstant(OWL.INVERSEOF), var("b")),//
                new SPOPredicate(relationName,var("u"), var("a"), var("v"))//
            },
            null // constraints
            );
    
}
 
Example #27
Source File: RuleOwlEquivalentProperty.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlEquivalentProperty(String relationName, Vocabulary vocab) {

    super(  "owl:equivalentProperty",//
            new SPOPredicate(relationName,var("b"), vocab.getConstant(OWL.EQUIVALENTPROPERTY), var("a")), //
            new SPOPredicate[] { //
                new SPOPredicate(relationName,var("a"), vocab.getConstant(OWL.EQUIVALENTPROPERTY), var("b"))//
            },//
            null//constraints
            );
    
}
 
Example #28
Source File: RuleOwlEquivalentClass.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlEquivalentClass(String relationName, Vocabulary vocab) {


    super(  "owl:equivalentClass",//
            new SPOPredicate(relationName,var("b"), vocab.getConstant(OWL.EQUIVALENTCLASS), var("a")), //
            new SPOPredicate[] { //
                new SPOPredicate(relationName,var("a"), vocab.getConstant(OWL.EQUIVALENTCLASS), var("b"))//
            },//
            null//constraints
            );
    
}
 
Example #29
Source File: RuleOwlTransitiveProperty2.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlTransitiveProperty2(String relationName, Vocabulary vocab) {

    super(  "owlTransitiveProperty2",//
            new SPOPredicate(relationName,var("b"), vocab.getConstant(RDF.TYPE), vocab.getConstant(OWL.TRANSITIVEPROPERTY)),
            new SPOPredicate[] { //
                new SPOPredicate(relationName,var("a"), vocab.getConstant(RDF.TYPE), vocab.getConstant(OWL.TRANSITIVEPROPERTY)),//
                new SPOPredicate(relationName,var("b"), vocab.getConstant(RDFS.SUBPROPERTYOF), var("a"))//
            }, new IConstraint[] {
    			Constraint.wrap(new NE(var("a"),var("b"))),
                }
            );
    
}
 
Example #30
Source File: RuleOwlInverseOf1.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param vocab
 */
public RuleOwlInverseOf1(String relationName, Vocabulary vocab) {

    super(  "owlInverseOf1",//
            new SPOPredicate(relationName,var("b"), vocab.getConstant(OWL.INVERSEOF), var("a")), //
            new SPOPredicate[] { //
                new SPOPredicate(relationName,var("a"), vocab.getConstant(OWL.INVERSEOF), var("b")),//
            },
            new IConstraint[] {
    			Constraint.wrap(new NE(var("a"),var("b")))
            }
            );
    
}