Skip to content
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

Merged
merged 7 commits into from
Nov 7, 2018
Merged

Feature/6.0 #26

merged 7 commits into from
Nov 7, 2018

Conversation

snowell
Copy link
Member

@snowell snowell commented Nov 6, 2018

Updates to examples to use Stark in support of https://github.com/stardog-union/stardog/issues/6466

Copy link
Member

@klinovp klinovp left a 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'
Copy link
Member

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?

Copy link
Member Author

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"),
Copy link
Member

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();
Copy link
Member

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()) {
Copy link
Member

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()
Copy link
Member

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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try-with-resources

@evren evren merged commit d097205 into develop Nov 7, 2018
@evren evren deleted the feature/6.0 branch November 7, 2018 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants