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
mhgrove:dist mhgrove$ cat input.nt | |
<urn:foo> <urn:bar> "literal". | |
mhgrove:dist mhgrove$ ./bin/stardog-admin db create -n foo -s input.nt | |
Bulk loading data to new database. | |
Parsing triples: 100% complete in 00:00:00 (1 triples - 0.2K triples/sec) | |
Parsing triples finished in 00:00:00.005 | |
Creating index: 100% complete in 00:00:00 (0.2K triples/sec) | |
Creating index finished in 00:00:00.005 | |
Computing statistics: 100% complete in 00:00:00 (0.2K triples/sec) | |
Computing statistics finished in 00:00:00.006 |
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
mhgrove:stardog-2.1.3 mhgrove$ ./bin/stardog-admin server start | |
mhgrove:stardog-2.1.3 mhgrove$ ./bin/stardog-admin db create -n describe | |
Creating index: 100% complete in 00:00:00 (0.0K triples/sec) | |
Creating index finished in 00:00:00.010 | |
Loading complete. | |
Inserted 0 triples in 00:00:00.082 at 0.0 triples/sec | |
Successfully created database 'describe'. | |
mhgrove:stardog-2.1.3 mhgrove$ ./bin/stardog data add --named-graph urn:context describe ~/Downloads/census-2011_qs103sc.ttl | |
Adding data from file: /Users/mhgrove/Downloads/census-2011_qs103sc.ttl |
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
@Test | |
public void ruleExample() throws Exception { | |
final String aRule = "PREFIX :<urn:test:>\n" + | |
" IF {\n" + | |
" ?r a :Rectangle ;\n" + | |
" :width ?w ;\n" + | |
" :height ?h\n" + | |
" BIND (?w * ?h AS ?area)\n" + | |
" }\n" + | |
" THEN {\n" + |
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
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
/* | |
* 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
Distinct | |
Projection | |
ProjectionElemList | |
ProjectionElem "g" | |
ProjectionElem "var35" | |
ProjectionElem "b" | |
ProjectionElem "c" | |
LeftJoin | |
LeftJoin | |
SingletonSet |
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 test; | |
import org.apache.commons.math.stat.descriptive.SummaryStatistics; | |
import org.openrdf.query.parser.sparql.SPARQLParser; | |
public class ParseTest { | |
public static void main(String[] args) throws Exception { | |
final String q = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n" + |
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
// some initialization which takes place in the constructor of the streamed | |
// protobug message writer | |
mBytes = new ByteArrayOutputStream((int)(64 * (1 << 10))); | |
coded = CodedOutputStream.newInstance(mBytes); | |
// then as protobuf messages come in, i append to the stream | |
// if the message puts us over the threshold of 64k, we write out what's in | |
// the buffer and start fresh | |
private void write(final MessageLite aObj) throws IOException { |
OlderNewer