-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/6.0 #26
Feature/6.0 #26
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Comments are minor nitpicks.
build.gradle
Outdated
@@ -5,7 +5,7 @@ task wrapper(type: Wrapper) { | |||
} | |||
|
|||
ext { | |||
stardogVersion = project.hasProperty("stardogVersion") ? project.getProperty("stardogVersion") : '5.3.0' | |||
stardogVersion = project.hasProperty("stardogVersion") ? project.getProperty("stardogVersion") : '6.0.0-SNAPSHOT-20181105' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be SNAPSHOT
or just 6.0.0
? These changes won't be merged till 6.0 is out, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely meant to have 6.0.0 here, actually. I was having versioning issues, so I guess this accidentally stuck around.
// You're not restricted to adding, or removing, data from a file. You can create `Statement` objects | ||
// containing information you want to add or remove from the database and make the modification wrt | ||
// that graph. Here we'll add a statement that we want added to our database. | ||
Statement aStatement = Values.statement(Values.iri("uri:subj"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation seems off here
@@ -139,7 +138,7 @@ private static void printCounts(final Connection theConn) throws StardogExceptio | |||
"}"); | |||
|
|||
aQuery.parameter("type", PERSON); | |||
TupleQueryResult aResult = aQuery.execute(); | |||
SelectQueryResult aResult = aQuery.execute(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use try-with-resources here as well?
System.out.println(result.getValue("s") + " with a score of: " + ((Literal) result.getValue("score")).doubleValue()); | ||
Optional<Value> s = result.value("s"); | ||
Optional<Literal> score = result.literal("score"); | ||
if (s.isPresent() && score.isPresent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means we won't print the literal if it's present but the score is missing. I know it probably won't happen but it looks slightly odd and it's not the behaviour we had before.
@@ -48,8 +48,8 @@ | |||
// it doesn't say whether the same dataset should be used for describing matched resources. | |||
// It should be otherwise queries like DESCRIBE :A FROM :g don't make sense but one may want to | |||
// describe resources matched in G1 based on information in G2. | |||
Dataset aDataset = ImmutableDataset.builder() | |||
.namedGraphs(Iterables.concat(theDataset.getDefaultGraphs(), theDataset.getNamedGraphs())) | |||
Dataset aDataset = Datasets.builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
@@ -74,8 +75,8 @@ public void testWordCountExtractor() throws Exception { | |||
IRI aDocIri = aDocsConn.putDocument(new File("input.pdf").toPath()); | |||
|
|||
String aQuery = "select ?wc { graph ?doc { ?doc <tag:stardog:example:wordcount> ?wc } }"; | |||
TupleQueryResult aRes = aConn.select(aQuery).parameter("doc", aDocIri).execute(); | |||
String wordCount = aRes.next().getBinding("wc").getValue().stringValue(); | |||
SelectQueryResult aRes = aConn.select(aQuery).parameter("doc", aDocIri).execute(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try-with-resources
Updates to examples to use Stark in support of https://github.com/stardog-union/stardog/issues/6466