This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.clarkparsia.pellet.examples; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import com.clarkparsia.pellet.api.kb.Ontology; | |
import com.clarkparsia.pellet.api.kb.OntologyFactory; | |
import com.clarkparsia.pellet.api.kb.OntologySyntax; | |
import com.clarkparsia.pellet.api.term.TermFactory; | |
import com.clarkparsia.pellet.api.term.entity.NamedClass; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prefix: : <http://example.com/#> | |
Class: Professor | |
DisjointWith: Student | |
Class: GraduateStudent | |
Class: UndergraduateStudent | |
Class: Student |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2010-2015 Clark & Parsia, LLC. <http://www.clarkparsia.com> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// start a transaction before adding the data. This is not required, | |
// but it is faster to group the entire add into a single transaction rather | |
// than rely on the auto commit of the underlying stardog connection. | |
aModel.begin(); | |
// read data into the model. note, this will add statement at a time. | |
// Bulk loading needs to be performed directly with the BulkUpdateHandler provided | |
// by the underlying graph, or by reading in files in RDF/XML format, which uses the | |
// bulk loader natively. Alternatively, you can load data into the Stardog | |
// database using SNARL, or via the command line client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aConn.begin(); | |
aConn.add().io() | |
.format(RDFFormat.N3) | |
.stream(new FileInputStream("data/sp2b_10k.n3")); | |
Model aGraph = Models2.newModel(Values.statement(Values.iri("urn:subj"), | |
Values.iri("urn:pred"), | |
Values.iri("urn:obj"))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReasoningConnection aReasoningConn = ConnectionConfiguration | |
.to("reasoningExampleTest") | |
.credentials("admin", "admin") | |
.reasoning(true) | |
.connect() | |
.as(ReasoningConnection.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2010-2015 Clark & Parsia, LLC. <http://www.clarkparsia.com> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We'll start out by creating a validator from our SNARL Connection | |
ICVConnection aValidator = aConn.as(ICVConnection.class); | |
// add add a constraint, which must be done in a transaction. | |
aValidator.addConstraint(aConstraint); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try (AdminConnection dbms = AdminConnectionConfiguration.toEmbeddedServer().credentials("admin", "admin").connect()) { | |
dbms.disk("icvWithGuard") // disk db named 'icvWithGuard' | |
.set(ICVOptions.ICV_ENABLED, true) // enable icv guard mode | |
.set(ICVOptions.ICV_REASONING_ENABLED, true) // specify that guard mode should use reasoning | |
.create(new File("data/sp2b_10k.n3")); // create the db, bulk loading the file(s) to start | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Distinct | |
Projection | |
ProjectionElemList | |
ProjectionElem "g" | |
ProjectionElem "var35" | |
ProjectionElem "b" | |
ProjectionElem "c" | |
LeftJoin | |
LeftJoin | |
SingletonSet |
OlderNewer