Skip to content

Commit

Permalink
Merge pull request #5 from fcrepo4-exts/fcrepo-1765
Browse files Browse the repository at this point in the history
don't query on JCR types
  • Loading branch information
ajs6f committed Nov 5, 2015
2 parents 0519e66 + 43af096 commit 7d433ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -19,7 +19,7 @@

<properties>
<ldpath.version>3.2.1</ldpath.version>
<fcrepo.version>${project.version}</fcrepo.version>
<fcrepo.version>4.4.1-SNAPSHOT</fcrepo.version>
<osgi.import.packages>
org.fcrepo.kernel.api,
org.fcrepo.http.api,
Expand Down
Expand Up @@ -23,6 +23,7 @@
import org.fcrepo.kernel.api.utils.iterators.RdfStream;
import org.fcrepo.kernel.modeshape.rdf.impl.DefaultIdentifierTranslator;
import org.fcrepo.kernel.modeshape.rdf.impl.PropertiesRdfContext;
import org.fcrepo.kernel.modeshape.rdf.impl.TypeRdfContext;
import org.fcrepo.transform.transformations.SparqlQueryTransform;

import org.junit.Test;
Expand All @@ -43,6 +44,7 @@
import static java.util.Objects.requireNonNull;
import static java.util.UUID.randomUUID;
import static org.fcrepo.kernel.api.RdfLexicon.REPOSITORY_NAMESPACE;
import static org.fcrepo.kernel.api.RdfLexicon.RDF_NAMESPACE;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

Expand All @@ -68,19 +70,19 @@ public class SparqlQueryTransformIT extends AbstractResourceIT {
private SparqlQueryTransform testObj;

@Test
public void testQueryPrimaryType() throws RepositoryException, IOException {
public void testQueryRdfType() throws RepositoryException, IOException {
final Session session = repo.login();
try {
final Container object = containerService.findOrCreate(session, "/testObject-" + randomUUID());

final String s = "SELECT ?x ?type\n" +
"WHERE { ?x <" + REPOSITORY_NAMESPACE + "primaryType> ?type }";
"WHERE { ?x <" + RDF_NAMESPACE + "type> ?type }";
try (final InputStream stringReader = new ByteArrayInputStream(s.getBytes())) {

testObj = new SparqlQueryTransform(stringReader);

final RdfStream stream = object.getTriples(new DefaultIdentifierTranslator(session),
PropertiesRdfContext.class);
TypeRdfContext.class);
try (final QueryExecution qexec = testObj.apply(stream)) {
final ResultSet results = requireNonNull(qexec).execSelect();
assertTrue(requireNonNull(results).hasNext());
Expand Down

0 comments on commit 7d433ab

Please sign in to comment.