http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java index f539e7c..a7c988b 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java @@ -23,7 +23,7 @@ import static java.util.Objects.requireNonNull; import java.util.Objects; import org.apache.http.annotation.Immutable; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.storage.TypeStorage; import com.google.common.collect.ImmutableSet; @@ -51,12 +51,12 @@ public class Type { /** * Uniquely identifies the Type within a {@link TypeStorage}. */ - private final RyaURI id; + private final RyaIRI id; /** * The names of {@link Property}s that may be part of an {@link TypedEntity} of this type. */ - private final ImmutableSet<RyaURI> propertyNames; + private final ImmutableSet<RyaIRI> propertyNames; /** * Constructs an instance of {@link Type}. @@ -64,7 +64,7 @@ public class Type { * @param id - Uniquely identifies the Type within a {@link TypeStorage}. (not null) * @param propertyNames - The names of {@link Property}s that may be part of an {@link TypedEntity} of this type. (not null) */ - public Type(final RyaURI id, final ImmutableSet<RyaURI> propertyNames) { + public Type(final RyaIRI id, final ImmutableSet<RyaIRI> propertyNames) { this.id = requireNonNull(id); this.propertyNames = requireNonNull(propertyNames); } @@ -72,14 +72,14 @@ public class Type { /** * @return Uniquely identifies the Type within a {@link TypeStorage}. */ - public RyaURI getId() { + public RyaIRI getId() { return id; } /** * @return The names of {@link Property}s that may be part of an {@link TypedEntity} of this type. */ - public ImmutableSet<RyaURI> getPropertyNames() { + public ImmutableSet<RyaIRI> getPropertyNames() { return propertyNames; }
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java index 0d019c2..816e7fa 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java @@ -27,7 +27,7 @@ import java.util.Optional; import org.apache.http.annotation.Immutable; import org.apache.rya.api.domain.RyaType; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableMap; @@ -47,12 +47,12 @@ public class TypedEntity { /** * The Subject of the {@link Entity} this view was derived from. */ - private final RyaURI subject; + private final RyaIRI subject; /** * The ID of the {@link Type} that defines the structure of this TypedEntity. */ - private final RyaURI typeId; + private final RyaIRI typeId; /** * {@code true} if the Entity's Type has been explicitly set to the {@link #typeId} @@ -66,7 +66,7 @@ public class TypedEntity { * </p> * They are mapped from property name to property object for quick lookup. */ - private final ImmutableMap<RyaURI, Property> optionalFields; + private final ImmutableMap<RyaIRI, Property> optionalFields; /** * Constructs an instance of {@link TypedEntity}. @@ -78,10 +78,10 @@ public class TypedEntity { * it has properties that happen to match that type's properties). * @param properties - The optional {@link Property} values of this {@link TypedEntity}. (not null) */ - private TypedEntity(final RyaURI subject, - final RyaURI dataTypeId, + private TypedEntity(final RyaIRI subject, + final RyaIRI dataTypeId, final boolean explicitlyTyped, - final ImmutableMap<RyaURI, Property> optionalFields) { + final ImmutableMap<RyaIRI, Property> optionalFields) { this.subject = requireNonNull(subject); typeId = requireNonNull(dataTypeId); this.optionalFields = requireNonNull(optionalFields); @@ -91,14 +91,14 @@ public class TypedEntity { /** * @return The Subject of the {@link Entity} this view was derived from. */ - public RyaURI getSubject() { + public RyaIRI getSubject() { return subject; } /** * @return The ID of the {@link Type} that defines the structure of this Entity. */ - public RyaURI getTypeId() { + public RyaIRI getTypeId() { return typeId; } @@ -125,7 +125,7 @@ public class TypedEntity { * @param propertyName - The name of {@link Property} that may be in this Entity. (not null) * @return The value of the Property if it has been set. */ - public Optional<RyaType> getPropertyValue(final RyaURI propertyName) { + public Optional<RyaType> getPropertyValue(final RyaIRI propertyName) { requireNonNull(propertyName); final Property field = optionalFields.get(propertyName); @@ -184,16 +184,16 @@ public class TypedEntity { @DefaultAnnotation(NonNull.class) public static class Builder { - private RyaURI subject; - private RyaURI typeId; + private RyaIRI subject; + private RyaIRI typeId; private boolean explicitlyTyped = false; - private final Map<RyaURI, Property> properties = new HashMap<>(); + private final Map<RyaIRI, Property> properties = new HashMap<>(); /** * @param subject - The Subject of the {@link Entity} this view was derived from. * @return This {@link Builder} so that method invocations may be chained. */ - public Builder setId(@Nullable final RyaURI subject) { + public Builder setId(@Nullable final RyaIRI subject) { this.subject = subject; return this; } @@ -202,7 +202,7 @@ public class TypedEntity { * @param typeId - The ID of the {@link Type} that defines the structure of this Entity. * @return This {@link Builder} so that method invocations may be chained. */ - public Builder setTypeId(@Nullable final RyaURI typeId) { + public Builder setTypeId(@Nullable final RyaIRI typeId) { this.typeId = typeId; return this; } http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java index 70efc3a..7102e63 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java @@ -31,7 +31,7 @@ import java.util.Set; import java.util.function.Consumer; import org.apache.rya.api.domain.RyaType; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.api.resolver.RdfToRyaConversions; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.model.Property; @@ -73,9 +73,9 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter private static final Logger LOG = LoggerFactory.getLogger(EntityQueryNode.class); /** - * The RyaURI that when used as the Predicate of a Statement Pattern indicates the Type of the Entities. + * The {@link RyaIRI} that when used as the Predicate of a Statement Pattern indicates the Type of the Entities. */ - private static final RyaURI TYPE_ID_URI = new RyaURI(RDF.TYPE.toString()); + private static final RyaIRI TYPE_ID_IRI = new RyaIRI(RDF.TYPE.toString()); // Provided at construction time. private final Type type; @@ -91,7 +91,7 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter private final Set<String> bindingNames; // Information about the objects of the patterns. - private final ImmutableMap<RyaURI, Var> objectVariables; + private final ImmutableMap<RyaIRI, Var> objectVariables; // Properties of the Type found in the query private final Set<Property> properties; @@ -133,17 +133,17 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter } // Any constant that appears in the Object portion of the SP will be used to make sure they match. - final Builder<RyaURI, Var> builder = ImmutableMap.builder(); + final Builder<RyaIRI, Var> builder = ImmutableMap.builder(); for(final StatementPattern sp : patterns) { final Var object = sp.getObjectVar(); final Var pred = sp.getPredicateVar(); - final RyaURI predURI = new RyaURI(pred.getValue().stringValue()); + final RyaIRI predIRI = new RyaIRI(pred.getValue().stringValue()); bindingNames.addAll(sp.getBindingNames()); if(object.isConstant() && !pred.getValue().equals(RDF.TYPE)) { final RyaType propertyType = RdfToRyaConversions.convertValue(object.getValue()); - properties.add(new Property(predURI, propertyType)); + properties.add(new Property(predIRI, propertyType)); } - builder.put(predURI, object); + builder.put(predIRI, object); } objectVariables = builder.build(); } @@ -209,10 +209,10 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter boolean typeFound = false; for(final StatementPattern pattern : patterns) { - final RyaURI predicate = new RyaURI(pattern.getPredicateVar().getValue().toString()); + final RyaIRI predicate = new RyaIRI(pattern.getPredicateVar().getValue().toString()); - if(predicate.equals(TYPE_ID_URI)) { - final RyaURI typeId = new RyaURI( pattern.getObjectVar().getValue().stringValue() ); + if(predicate.equals(TYPE_ID_IRI)) { + final RyaIRI typeId = new RyaIRI( pattern.getObjectVar().getValue().stringValue() ); if(typeId.equals(type.getId())) { typeFound = true; } else { @@ -241,8 +241,8 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter for(final StatementPattern pattern : patterns) { // Skip TYPE patterns. - final RyaURI predicate = new RyaURI( pattern.getPredicateVar().getValue().toString() ); - if(predicate.equals(TYPE_ID_URI)) { + final RyaIRI predicate = new RyaIRI( pattern.getPredicateVar().getValue().toString() ); + if(predicate.equals(TYPE_ID_IRI)) { continue; } @@ -283,7 +283,7 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter if(subjectIsConstant) { // if it is, fetch that value and then fetch the entity for the subject. subj = subjectConstant.get(); - entitiesCursor = entities.search(Optional.of(new RyaURI(subj)), type, properties); + entitiesCursor = entities.search(Optional.of(new RyaIRI(subj)), type, properties); } else { entitiesCursor = entities.search(Optional.empty(), type, properties); } @@ -292,8 +292,8 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter final TypedEntity typedEntity = entitiesCursor.next(); final ImmutableCollection<Property> properties = typedEntity.getProperties(); //ensure properties match and only add properties that are in the statement patterns to the binding set - for(final RyaURI key : objectVariables.keySet()) { - final Optional<RyaType> prop = typedEntity.getPropertyValue(new RyaURI(key.getData())); + for(final RyaIRI key : objectVariables.keySet()) { + final Optional<RyaType> prop = typedEntity.getPropertyValue(new RyaIRI(key.getData())); if(prop.isPresent()) { final RyaType type = prop.get(); final String bindingName = objectVariables.get(key).getName(); http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java index 6f0b9ae..22dad92 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java @@ -21,7 +21,7 @@ package org.apache.rya.indexing.entity.storage; import java.util.Optional; import java.util.Set; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.model.Property; import org.apache.rya.indexing.entity.model.Type; @@ -42,13 +42,13 @@ public interface EntityStorage extends RyaObjectStorage<Entity> { * Search the stored {@link Entity}s that have a specific {@link Type} as * well as the provided {@link Property} values. * - * @param subject - The {@link RyaURI} subject of the Entity. (Optional) + * @param subject - The {@link RyaIRI} subject of the Entity. (Optional) * @param type - The {@link Type} of the Entities. (not null) * @param properties - The {@link Property} values that must be set on the Entity. (not null) * @return A {@link CloseableIterator} over the {@link TypedEntity}s that match the search parameters. * @throws EntityStorageException A problem occurred while searching the storage. */ - public ConvertingCursor<TypedEntity> search(final Optional<RyaURI> subject, Type type, Set<Property> properties) throws EntityStorageException; + public ConvertingCursor<TypedEntity> search(final Optional<RyaIRI> subject, Type type, Set<Property> properties) throws EntityStorageException; /** * Indicates a problem while interacting with an {@link EntityStorage}. http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java index 31b1790..5a23044 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java @@ -20,7 +20,7 @@ package org.apache.rya.indexing.entity.storage; import java.util.Optional; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.EntityIndexException; import org.apache.rya.indexing.entity.model.Type; import org.apache.rya.indexing.entity.storage.mongo.ConvertingCursor; @@ -49,7 +49,7 @@ public interface TypeStorage { * @return The {@link Type} if one exists for the ID. * @throws TypeStorageException A problem occurred while fetching from the storage. */ - public Optional<Type> get(RyaURI typeId) throws TypeStorageException; + public Optional<Type> get(RyaIRI typeId) throws TypeStorageException; /** * Get all {@link Type}s that include a specific {@link Property} name. @@ -59,7 +59,7 @@ public interface TypeStorage { * @throws TypeStorageException A problem occurred while searching for the Types * that have the Property name. */ - public ConvertingCursor<Type> search(RyaURI propertyName) throws TypeStorageException; + public ConvertingCursor<Type> search(RyaIRI propertyName) throws TypeStorageException; /** * Deletes a {@link Type} from the storage. @@ -68,7 +68,7 @@ public interface TypeStorage { * @return {@code true} if something was deleted; otherwise {@code false}. * @throws TypeStorageException A problem occurred while deleting from the storage. */ - public boolean delete(RyaURI typeId) throws TypeStorageException; + public boolean delete(RyaIRI typeId) throws TypeStorageException; /** * A problem occurred while interacting with a {@link TypeStorage}. http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java index 7333de1..5d1a1a6 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.stream.Collectors; import org.apache.rya.api.domain.RyaType; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.model.Property; import org.apache.rya.indexing.entity.storage.mongo.key.MongoDbSafeKey; @@ -60,7 +60,7 @@ public class EntityDocumentConverter implements DocumentConverter<Entity> { .collect(Collectors.toList())); final Document propertiesDoc = new Document(); - for(final RyaURI typeId : entity.getProperties().keySet()) { + for(final RyaIRI typeId : entity.getProperties().keySet()) { final Document typePropertiesDoc = new Document(); entity.getProperties().get(typeId) .forEach((propertyNameUri, property) -> { @@ -112,10 +112,10 @@ public class EntityDocumentConverter implements DocumentConverter<Entity> { // Perform the conversion. final Entity.Builder builder = Entity.builder() - .setSubject( new RyaURI(document.getString(SUBJECT)) ); + .setSubject( new RyaIRI(document.getString(SUBJECT)) ); ((List<String>)document.get(EXPLICIT_TYPE_IDS)).stream() - .forEach(explicitTypeId -> builder.setExplicitType(new RyaURI(explicitTypeId))); + .forEach(explicitTypeId -> builder.setExplicitType(new RyaIRI(explicitTypeId))); final Document propertiesDoc = (Document) document.get(PROPERTIES); for(final String typeId : propertiesDoc.keySet()) { @@ -124,7 +124,7 @@ public class EntityDocumentConverter implements DocumentConverter<Entity> { final String decodedPropertyName = MongoDbSafeKey.decodeKey(propertyName); final Document value = (Document) typePropertiesDoc.get(propertyName); final RyaType propertyValue = ryaTypeConverter.fromDocument( value ); - builder.setProperty(new RyaURI(typeId), new Property(new RyaURI(decodedPropertyName), propertyValue)); + builder.setProperty(new RyaIRI(typeId), new Property(new RyaIRI(decodedPropertyName), propertyValue)); } } http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java index 87634d7..63a0046 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java @@ -31,7 +31,7 @@ import java.util.stream.Stream; import org.apache.commons.configuration.ConfigurationException; import org.apache.log4j.Logger; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.model.Property; import org.apache.rya.indexing.entity.model.Type; @@ -175,7 +175,7 @@ public class MongoEntityStorage implements EntityStorage { } @Override - public Optional<Entity> get(final RyaURI subject) throws EntityStorageException { + public Optional<Entity> get(final RyaIRI subject) throws EntityStorageException { requireNonNull(subject); try { @@ -194,7 +194,7 @@ public class MongoEntityStorage implements EntityStorage { } @Override - public ConvertingCursor<TypedEntity> search(final Optional<RyaURI> subject, final Type type, final Set<Property> properties) throws EntityStorageException { + public ConvertingCursor<TypedEntity> search(final Optional<RyaIRI> subject, final Type type, final Set<Property> properties) throws EntityStorageException { requireNonNull(type); requireNonNull(properties); @@ -238,7 +238,7 @@ public class MongoEntityStorage implements EntityStorage { } @Override - public boolean delete(final RyaURI subject) throws EntityStorageException { + public boolean delete(final RyaIRI subject) throws EntityStorageException { requireNonNull(subject); try { @@ -253,7 +253,7 @@ public class MongoEntityStorage implements EntityStorage { } } - private static Bson makeSubjectFilter(final RyaURI subject) { + private static Bson makeSubjectFilter(final RyaIRI subject) { return Filters.eq(EntityDocumentConverter.SUBJECT, subject.getData()); } @@ -261,11 +261,11 @@ public class MongoEntityStorage implements EntityStorage { return Filters.eq(EntityDocumentConverter.VERSION, version); } - private static Bson makeExplicitTypeFilter(final RyaURI typeId) { + private static Bson makeExplicitTypeFilter(final RyaIRI typeId) { return Filters.eq(EntityDocumentConverter.EXPLICIT_TYPE_IDS, typeId.getData()); } - private static Stream<Bson> makePropertyFilters(final RyaURI typeId, final Property property) { + private static Stream<Bson> makePropertyFilters(final RyaIRI typeId, final Property property) { final String propertyName = property.getName().getData(); final String encodedPropertyName = MongoDbSafeKey.encodeKey(propertyName); @@ -310,21 +310,21 @@ public class MongoEntityStorage implements EntityStorage { /** * Searches the Entity storage for all Entities that contain all the * specified explicit type IDs. - * @param explicitTypeIds the {@link ImmutableList} of {@link RyaURI}s that + * @param explicitTypeIds the {@link ImmutableList} of {@link RyaIRI}s that * are being searched for. * @return the {@link List} of {@link Entity}s that have all the specified * explicit type IDs. If nothing was found an empty {@link List} is * returned. * @throws EntityStorageException */ - private List<Entity> searchHasAllExplicitTypes(final ImmutableList<RyaURI> explicitTypeIds) throws EntityStorageException { + private List<Entity> searchHasAllExplicitTypes(final ImmutableList<RyaIRI> explicitTypeIds) throws EntityStorageException { final List<Entity> hasAllExplicitTypesEntities = new ArrayList<>(); if (!explicitTypeIds.isEmpty()) { // Grab the first type from the explicit type IDs. - final RyaURI firstType = explicitTypeIds.get(0); + final RyaIRI firstType = explicitTypeIds.get(0); // Check if that type exists anywhere in storage. - final List<RyaURI> subjects = new ArrayList<>(); + final List<RyaIRI> subjects = new ArrayList<>(); Optional<Type> type; try { if (mongoTypeStorage == null) { @@ -339,13 +339,13 @@ public class MongoEntityStorage implements EntityStorage { final ConvertingCursor<TypedEntity> cursor = search(Optional.empty(), type.get(), Collections.emptySet()); while (cursor.hasNext()) { final TypedEntity typedEntity = cursor.next(); - final RyaURI subject = typedEntity.getSubject(); + final RyaIRI subject = typedEntity.getSubject(); subjects.add(subject); } } // Now grab all the Entities that have the subjects we found. - for (final RyaURI subject : subjects) { + for (final RyaIRI subject : subjects) { final Optional<Entity> entityFromSubject = get(subject); if (entityFromSubject.isPresent()) { final Entity candidateEntity = entityFromSubject.get(); http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java index 0083671..d0aa2fc 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java @@ -22,7 +22,7 @@ import static java.util.Objects.requireNonNull; import java.util.Optional; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Type; import org.apache.rya.indexing.entity.storage.TypeStorage; import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException; @@ -83,7 +83,7 @@ public class MongoTypeStorage implements TypeStorage { } @Override - public Optional<Type> get(final RyaURI typeId) throws TypeStorageException { + public Optional<Type> get(final RyaIRI typeId) throws TypeStorageException { requireNonNull(typeId); try { @@ -102,7 +102,7 @@ public class MongoTypeStorage implements TypeStorage { } @Override - public ConvertingCursor<Type> search(final RyaURI propertyName) throws TypeStorageException { + public ConvertingCursor<Type> search(final RyaIRI propertyName) throws TypeStorageException { requireNonNull(propertyName); try { @@ -128,7 +128,7 @@ public class MongoTypeStorage implements TypeStorage { } @Override - public boolean delete(final RyaURI typeId) throws TypeStorageException { + public boolean delete(final RyaIRI typeId) throws TypeStorageException { requireNonNull(typeId); try { @@ -143,7 +143,7 @@ public class MongoTypeStorage implements TypeStorage { } } - private static Bson makeIdFilter(final RyaURI typeId) { + private static Bson makeIdFilter(final RyaIRI typeId) { return Filters.eq(TypeDocumentConverter.ID, typeId.getData()); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java index 37c65bb..1f072e2 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java @@ -23,7 +23,7 @@ import static java.util.Objects.requireNonNull; import java.util.ArrayList; import java.util.List; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Type; import org.bson.Document; @@ -69,11 +69,11 @@ public class TypeDocumentConverter implements DocumentConverter<Type> { "' because its '" + PROPERTY_NAMES + "' field is missing."); } - final RyaURI typeId = new RyaURI( document.getString(ID) ); + final RyaIRI typeId = new RyaIRI( document.getString(ID) ); - final ImmutableSet.Builder<RyaURI> propertyNames = ImmutableSet.builder(); + final ImmutableSet.Builder<RyaIRI> propertyNames = ImmutableSet.builder(); ((List<String>) document.get(PROPERTY_NAMES)) - .forEach(propertyName -> propertyNames.add(new RyaURI(propertyName))); + .forEach(propertyName -> propertyNames.add(new RyaIRI(propertyName))); return new Type(typeId, propertyNames.build()); } http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java index 26247a6..c495e17 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java @@ -37,7 +37,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.log4j.Logger; import org.apache.rya.api.domain.RyaStatement; import org.apache.rya.api.domain.RyaType; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.model.Property; import org.apache.rya.indexing.entity.model.Type; @@ -68,7 +68,7 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary /** * When this IRI is the Predicate of a Statement, it indicates a {@link Type} for an {@link Entity}. */ - private static final RyaURI TYPE_URI = new RyaURI( RDF.TYPE.toString() ); + private static final RyaIRI TYPE_IRI = new RyaIRI( RDF.TYPE.toString() ); protected final AtomicReference<StatefulMongoDBRdfConfiguration> configuration = new AtomicReference<>(); private final AtomicReference<EntityStorage> entities = new AtomicReference<>(); @@ -108,10 +108,10 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary public void storeStatements(final Collection<RyaStatement> statements) throws IOException { requireNonNull(statements); - final Map<RyaURI,List<RyaStatement>> groupedBySubject = statements.stream() + final Map<RyaIRI,List<RyaStatement>> groupedBySubject = statements.stream() .collect(groupingBy(RyaStatement::getSubject)); - for(final Entry<RyaURI, List<RyaStatement>> entry : groupedBySubject.entrySet()) { + for(final Entry<RyaIRI, List<RyaStatement>> entry : groupedBySubject.entrySet()) { try { updateEntity(entry.getKey(), entry.getValue()); } catch (final IndexingException e) { @@ -127,7 +127,7 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary * @param statements - Statements that the {@link Entity} will be updated with. (not null) * @throws IndexingException */ - private void updateEntity(final RyaURI subject, final Collection<RyaStatement> statements) throws IndexingException { + private void updateEntity(final RyaIRI subject, final Collection<RyaStatement> statements) throws IndexingException { requireNonNull(subject); requireNonNull(statements); @@ -153,20 +153,20 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary for(final RyaStatement statement : statements) { // The Statement is setting an Explicit Type ID for the Entity. - if(Objects.equal(TYPE_URI, statement.getPredicate())) { - final RyaURI typeId = new RyaURI(statement.getObject().getData()); + if(Objects.equal(TYPE_IRI, statement.getPredicate())) { + final RyaIRI typeId = new RyaIRI(statement.getObject().getData()); updated.setExplicitType(typeId); } // The Statement is adding a Property to the Entity. else { - final RyaURI propertyName = statement.getPredicate(); + final RyaIRI propertyName = statement.getPredicate(); final RyaType propertyValue = statement.getObject(); try(final ConvertingCursor<Type> typesIt = types.search(propertyName)) { // Set the Property for each type that includes the Statement's predicate. while(typesIt.hasNext()) { - final RyaURI typeId = typesIt.next().getId(); + final RyaIRI typeId = typesIt.next().getId(); updated.setProperty(typeId, new Property(propertyName, propertyValue)); } } catch (final TypeStorageException | IOException e) { @@ -202,9 +202,9 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary final Entity.Builder updated = Entity.builder(oldEntity); updated.setVersion(oldEntity.getVersion() + 1); - if(TYPE_URI.equals(statement.getPredicate())) { + if(TYPE_IRI.equals(statement.getPredicate())) { // If the Type ID already isn't in the list of explicit types, then do nothing. - final RyaURI typeId = new RyaURI( statement.getObject().getData() ); + final RyaIRI typeId = new RyaIRI( statement.getObject().getData() ); if(!oldEntity.getExplicitTypeIds().contains(typeId)) { return Optional.empty(); } @@ -213,11 +213,11 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary updated.unsetExplicitType(typeId); } else { // If the deleted property appears within the old entity's properties, then remove it. - final RyaURI deletedPropertyName = statement.getPredicate(); + final RyaIRI deletedPropertyName = statement.getPredicate(); boolean propertyWasPresent = false; - for(final RyaURI typeId : oldEntity.getProperties().keySet()) { - for(final RyaURI propertyName : oldEntity.getProperties().get(typeId).keySet()) { + for(final RyaIRI typeId : oldEntity.getProperties().keySet()) { + for(final RyaIRI propertyName : oldEntity.getProperties().get(typeId).keySet()) { if(deletedPropertyName.equals(propertyName)) { propertyWasPresent = true; updated.unsetProperty(typeId, deletedPropertyName); @@ -255,7 +255,7 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary } @Override - public void dropGraph(final RyaURI... graphs) { + public void dropGraph(final RyaIRI... graphs) { // We do not support graphs when performing entity centric indexing. } http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java index 91f1146..6bc3680 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java @@ -22,7 +22,7 @@ import static java.util.Objects.requireNonNull; import java.util.Optional; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.storage.EntityStorage; import org.apache.rya.indexing.entity.storage.EntityStorage.EntityStorageException; @@ -36,7 +36,7 @@ import edu.umd.cs.findbugs.annotations.NonNull; * Performs update operations over an {@link EntityStorage}. */ @DefaultAnnotation(NonNull.class) -public class EntityUpdater implements MongoDocumentUpdater<RyaURI, Entity>{ +public class EntityUpdater implements MongoDocumentUpdater<RyaIRI, Entity>{ private final EntityStorage storage; @@ -68,7 +68,7 @@ public class EntityUpdater implements MongoDocumentUpdater<RyaURI, Entity>{ } @Override - public Optional<Entity> getOld(final RyaURI key) throws EntityStorageException { + public Optional<Entity> getOld(final RyaIRI key) throws EntityStorageException { try { return storage.get(key); } catch (final ObjectStorageException e) { http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java index c2086d2..97c5ec2 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java @@ -33,7 +33,7 @@ import org.apache.log4j.Logger; import org.apache.rya.accumulo.experimental.AbstractAccumuloIndexer; import org.apache.rya.api.RdfCloudTripleStoreConfiguration; import org.apache.rya.api.domain.RyaStatement; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.api.log.LogUtils; import org.apache.rya.api.persist.RyaDAO; import org.apache.rya.indexing.external.accumulo.AccumuloPcjStorageSupplier; @@ -260,7 +260,7 @@ public class PrecomputedJoinIndexer extends AbstractAccumuloIndexer { } @Override - public void dropGraph(final RyaURI... graphs) { + public void dropGraph(final RyaIRI... graphs) { log.warn("PCJ indices do not store Graph metadata, so graph results can not be dropped."); } http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java index 36839b3..7f4a0bd 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java @@ -27,7 +27,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.log4j.Logger; import org.apache.rya.api.domain.RyaStatement; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.api.resolver.RyaToRdfConversions; import org.apache.rya.indexing.StatementConstraints; import org.apache.rya.mongodb.MongoDBRdfConfiguration; @@ -182,7 +182,7 @@ public abstract class AbstractMongoIndexer<T extends IndexingMongoDBStorageStrat } @Override - public void dropGraph(final RyaURI... graphs) { + public void dropGraph(final RyaIRI... graphs) { throw new UnsupportedOperationException(); } http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java index f392b5e..17e32c3 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java @@ -26,7 +26,7 @@ import java.util.Optional; import java.util.Set; import org.apache.hadoop.conf.Configuration; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.model.Property; import org.apache.rya.indexing.entity.model.Type; @@ -64,7 +64,7 @@ public class MongoDbSmartUri implements SmartUriStorage { } @Override - public void storeEntity(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException { + public void storeEntity(final RyaIRI subject, final Map<IRI, Value> map) throws SmartUriException { checkInit(); final IRI uri = SmartUriAdapter.serializeUri(subject, map); @@ -103,7 +103,7 @@ public class MongoDbSmartUri implements SmartUriStorage { } @Override - public Entity queryEntity(final RyaURI subject) throws SmartUriException { + public Entity queryEntity(final RyaIRI subject) throws SmartUriException { checkInit(); // Query it. http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java index bd04368..c420fba 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java @@ -20,12 +20,12 @@ package org.apache.rya.indexing.mongodb.update; import java.util.Optional; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.mongodb.IndexingException; /** * Stores and provides access to objects of type T. - * The RyaURI subject is the primary storage key used. + * The {@link RyaIRI} subject is the primary storage key used. * @param <T> - The type of object to store/access. */ public interface RyaObjectStorage<T> { @@ -46,7 +46,7 @@ public interface RyaObjectStorage<T> { * @return The Object if one exists for the subject. * @throws ObjectStorageException A problem occurred while fetching the Object from the storage. */ - public Optional<T> get(RyaURI subject) throws ObjectStorageException; + public Optional<T> get(RyaIRI subject) throws ObjectStorageException; /** * Update the state of an {@link RyaObjectStorage#T}. @@ -65,7 +65,7 @@ public interface RyaObjectStorage<T> { * @return {@code true} if something was deleted; otherwise {@code false}. * @throws ObjectStorageException A problem occurred while deleting from the storage. */ - public boolean delete(RyaURI subject) throws ObjectStorageException; + public boolean delete(RyaIRI subject) throws ObjectStorageException; /** * Indicates a problem while interacting with an {@link RyaObjectStorage}. http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java index d46d310..21d5ea5 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java @@ -36,7 +36,7 @@ import org.apache.http.client.utils.URIBuilder; import org.apache.http.client.utils.URLEncodedUtils; import org.apache.http.message.BasicNameValuePair; import org.apache.rya.api.domain.RyaType; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.api.resolver.RdfToRyaConversions; import org.apache.rya.api.resolver.RyaToRdfConversions; import org.apache.rya.indexing.entity.model.Entity; @@ -71,11 +71,11 @@ public class SmartUriAdapter { private SmartUriAdapter() { } - private static IRI createTypePropertiesUri(final ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> typeProperties) throws SmartUriException { + private static IRI createTypePropertiesUri(final ImmutableMap<RyaIRI, ImmutableMap<RyaIRI, Property>> typeProperties) throws SmartUriException { final List<NameValuePair> nameValuePairs = new ArrayList<>(); - for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> typeProperty : typeProperties.entrySet()) { - final RyaURI type = typeProperty.getKey(); - final Map<RyaURI, Property> propertyMap = typeProperty.getValue(); + for (final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> typeProperty : typeProperties.entrySet()) { + final RyaIRI type = typeProperty.getKey(); + final Map<RyaIRI, Property> propertyMap = typeProperty.getValue(); final IRI typeUri = createIndividualTypeWithPropertiesUri(type, propertyMap); final String keyString = type.getDataType().getLocalName(); final String valueString = typeUri.getLocalName(); @@ -97,7 +97,7 @@ public class SmartUriAdapter { return VF.createIRI(uriString); } - private static String getShortNameForType(final RyaURI type) throws SmartUriException { + private static String getShortNameForType(final RyaIRI type) throws SmartUriException { final String shortName = VF.createIRI(type.getData()).getLocalName(); return shortName; } @@ -118,18 +118,18 @@ public class SmartUriAdapter { return formattedUriString; } - private static Map<RyaURI, String> createTypeMap(final List<RyaURI> types) throws SmartUriException { - final Map<RyaURI, String> map = new LinkedHashMap<>(); - for (final RyaURI type : types) { + private static Map<RyaIRI, String> createTypeMap(final List<RyaIRI> types) throws SmartUriException { + final Map<RyaIRI, String> map = new LinkedHashMap<>(); + for (final RyaIRI type : types) { final String shortName = getShortNameForType(type); map.put(type, shortName); } return map; } - private static IRI createTypeMapUri(final List<RyaURI> types) throws SmartUriException { + private static IRI createTypeMapUri(final List<RyaIRI> types) throws SmartUriException { final List<NameValuePair> nameValuePairs = new ArrayList<>(); - for (final RyaURI type : types) { + for (final RyaIRI type : types) { final String shortName = getShortNameForType(type); nameValuePairs.add(new BasicNameValuePair(type.getData(), shortName)); } @@ -149,11 +149,11 @@ public class SmartUriAdapter { return VF.createIRI(uriString); } - private static Map<RyaURI, String> convertUriToTypeMap(final IRI typeMapUri) throws SmartUriException { - final Map<RyaURI, String> map = new HashMap<>(); + private static Map<RyaIRI, String> convertIriToTypeMap(final IRI typeMapIri) throws SmartUriException { + final Map<RyaIRI, String> map = new HashMap<>(); java.net.URI uri; try { - final URIBuilder uriBuilder = new URIBuilder(typeMapUri.stringValue()); + final URIBuilder uriBuilder = new URIBuilder(typeMapIri.stringValue()); uri = uriBuilder.build(); } catch (final URISyntaxException e) { throw new SmartUriException("Unable to parse Rya type map in Smart URI", e); @@ -164,16 +164,16 @@ public class SmartUriAdapter { for (final NameValuePair param : params) { final String name = param.getName(); final String value = param.getValue(); - final RyaURI type = new RyaURI(name); + final RyaIRI type = new RyaIRI(name); map.put(type, value); } return map; } - private static IRI createIndividualTypeWithPropertiesUri(final RyaURI type, final Map<RyaURI, Property> map) throws SmartUriException { + private static IRI createIndividualTypeWithPropertiesUri(final RyaIRI type, final Map<RyaIRI, Property> map) throws SmartUriException { final List<NameValuePair> nameValuePairs = new ArrayList<>(); - for (final Entry<RyaURI, Property> entry : map.entrySet()) { - final RyaURI key = entry.getKey(); + for (final Entry<RyaIRI, Property> entry : map.entrySet()) { + final RyaIRI key = entry.getKey(); final Property property = entry.getValue(); final RyaType ryaType = property.getValue(); @@ -198,41 +198,41 @@ public class SmartUriAdapter { return VF.createIRI(uriString); } - private static Entity convertMapToEntity(final RyaURI subject, final Map<RyaURI, Map<IRI, Value>> map) { + private static Entity convertMapToEntity(final RyaIRI subject, final Map<RyaIRI, Map<IRI, Value>> map) { final Entity.Builder entityBuilder = Entity.builder(); entityBuilder.setSubject(subject); - for (final Entry<RyaURI, Map<IRI, Value>> typeEntry : map.entrySet()) { - final RyaURI type = typeEntry.getKey(); + for (final Entry<RyaIRI, Map<IRI, Value>> typeEntry : map.entrySet()) { + final RyaIRI type = typeEntry.getKey(); final Map<IRI, Value> subMap = typeEntry.getValue(); entityBuilder.setExplicitType(type); for (final Entry<IRI, Value> entry : subMap.entrySet()) { final IRI uri = entry.getKey(); final Value value = entry.getValue(); - final RyaURI ryaUri = new RyaURI(uri.stringValue()); - final RyaURI ryaName = new RyaURI(uri.stringValue()); + final RyaIRI ryaIri = new RyaIRI(uri.stringValue()); + final RyaIRI ryaName = new RyaIRI(uri.stringValue()); final RyaType ryaType = new RyaType(value.stringValue()); final Property property = new Property(ryaName, ryaType); - entityBuilder.setProperty(ryaUri, property); + entityBuilder.setProperty(ryaIri, property); } } final Entity entity = entityBuilder.build(); return entity; } - public static RyaURI findSubject(final IRI uri) throws SmartUriException { + public static RyaIRI findSubject(final IRI uri) throws SmartUriException { final String uriString = uri.stringValue(); return findSubject(uriString); } - public static RyaURI findSubject(final String uriString) throws SmartUriException { + public static RyaIRI findSubject(final String uriString) throws SmartUriException { java.net.URI uri; try { uri = new java.net.URI(uriString); } catch (final URISyntaxException e) { throw new SmartUriException("Could not find subject in Smart URI", e); } - final RyaURI subject; + final RyaIRI subject; final String fullFragment = uri.getFragment(); if (fullFragment != null) { final int queryPosition = fullFragment.indexOf("?"); @@ -241,7 +241,7 @@ public class SmartUriAdapter { partialFragment = fullFragment.substring(0, queryPosition); } final String subjectString = uri.getScheme() + ":" + uri.getSchemeSpecificPart() + "#" + partialFragment; - subject = new RyaURI(subjectString); + subject = new RyaIRI(subjectString); } else { final int queryPosition = uriString.indexOf("?"); String subjectString = null; @@ -250,7 +250,7 @@ public class SmartUriAdapter { } else { subjectString = uriString; } - subject = new RyaURI(subjectString); + subject = new RyaIRI(subjectString); } return subject; @@ -267,22 +267,22 @@ public class SmartUriAdapter { final Map<IRI, Value> objectMap = new LinkedHashMap<>(); // Adds the entity's types to the Smart URI - final List<RyaURI> typeIds = entity.getExplicitTypeIds(); - final Map<RyaURI, String> ryaTypeMap = createTypeMap(typeIds); + final List<RyaIRI> typeIds = entity.getExplicitTypeIds(); + final Map<RyaIRI, String> ryaTypeMap = createTypeMap(typeIds); final IRI ryaTypeMapUri = createTypeMapUri(typeIds); final RyaType valueRyaType = new RyaType(XMLSchema.ANYURI, ryaTypeMapUri.stringValue()); final Value typeValue = RyaToRdfConversions.convertValue(valueRyaType); objectMap.put(RYA_TYPES_URI, typeValue); - final RyaURI subject = entity.getSubject(); - final Map<RyaURI, ImmutableMap<RyaURI, Property>> typeMap = entity.getProperties(); - for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> typeEntry : typeMap.entrySet()) { - final RyaURI type = typeEntry.getKey(); + final RyaIRI subject = entity.getSubject(); + final Map<RyaIRI, ImmutableMap<RyaIRI, Property>> typeMap = entity.getProperties(); + for (final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> typeEntry : typeMap.entrySet()) { + final RyaIRI type = typeEntry.getKey(); String typeShortName = ryaTypeMap.get(type); typeShortName = typeShortName != null ? typeShortName + "." : ""; - final ImmutableMap<RyaURI, Property> typeProperties = typeEntry.getValue(); - for (final Entry<RyaURI, Property> properties : typeProperties.entrySet()) { - final RyaURI key = properties.getKey(); + final ImmutableMap<RyaIRI, Property> typeProperties = typeEntry.getValue(); + for (final Entry<RyaIRI, Property> properties : typeProperties.entrySet()) { + final RyaIRI key = properties.getKey(); final Property property = properties.getValue(); final String valueString = property.getValue().getData(); final RyaType ryaType = property.getValue(); @@ -305,13 +305,13 @@ public class SmartUriAdapter { /** * Serializes a map into a URI. - * @param subject the {@link RyaURI} subject of the Entity. Identifies the + * @param subject the {@link RyaIRI} subject of the Entity. Identifies the * thing that is being represented as an Entity. * @param map the {@link Map} of {@link IRI}s to {@link Value}s. * @return the Smart {@link IRI}. * @throws SmartUriException */ - public static IRI serializeUri(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException { + public static IRI serializeUri(final RyaIRI subject, final Map<IRI, Value> map) throws SmartUriException { final String subjectData = subject.getData(); final int fragmentPosition = subjectData.indexOf("#"); String prefix = subjectData; @@ -389,12 +389,12 @@ public class SmartUriAdapter { throw new SmartUriException("Unable to deserialize Smart URI", e); } final Map<IRI, Value> map = new HashMap<>(); - final RyaURI subject = findSubject(iri.stringValue()); + final RyaIRI subject = findSubject(iri.stringValue()); final List<NameValuePair> parameters = uriBuilder.getQueryParams(); - Map<RyaURI, String> entityTypeMap = new LinkedHashMap<>(); - Map<String, RyaURI> invertedEntityTypeMap = new LinkedHashMap<>(); - final Map<RyaURI, Map<IRI, Value>> fullMap = new LinkedHashMap<>(); + Map<RyaIRI, String> entityTypeMap = new LinkedHashMap<>(); + Map<String, RyaIRI> invertedEntityTypeMap = new LinkedHashMap<>(); + final Map<RyaIRI, Map<IRI, Value>> fullMap = new LinkedHashMap<>(); for (final NameValuePair pair : parameters) { final String keyString = pair.getName(); final String valueString = pair.getValue(); @@ -409,13 +409,13 @@ public class SmartUriAdapter { final IRI type = TypeDeterminer.determineType(decoded); if (type == XMLSchema.ANYURI) { if (keyString.equals(RYA_TYPES_URI.getLocalName())) { - entityTypeMap = convertUriToTypeMap(VF.createIRI(decoded)); + entityTypeMap = convertIriToTypeMap(VF.createIRI(decoded)); invertedEntityTypeMap = HashBiMap.create(entityTypeMap).inverse(); } } else { final int keyPrefixLocation = keyString.indexOf("."); final String keyPrefix = keyString.substring(0, keyPrefixLocation); - final RyaURI keyCorrespondingType = invertedEntityTypeMap.get(keyPrefix); + final RyaIRI keyCorrespondingType = invertedEntityTypeMap.get(keyPrefix); final String keyName = keyString.substring(keyPrefixLocation + 1, keyString.length()); final RyaType ryaType = new RyaType(type, valueString); @@ -452,12 +452,12 @@ public class SmartUriAdapter { throw new SmartUriException("Unable to deserialize Smart URI", e); } - final RyaURI subject = findSubject(uri.stringValue()); + final RyaIRI subject = findSubject(uri.stringValue()); final List<NameValuePair> parameters = uriBuilder.getQueryParams(); - Map<RyaURI, String> entityTypeMap = new LinkedHashMap<>(); - Map<String, RyaURI> invertedEntityTypeMap = new LinkedHashMap<>(); - final Map<RyaURI, Map<IRI, Value>> fullMap = new LinkedHashMap<>(); + Map<RyaIRI, String> entityTypeMap = new LinkedHashMap<>(); + Map<String, RyaIRI> invertedEntityTypeMap = new LinkedHashMap<>(); + final Map<RyaIRI, Map<IRI, Value>> fullMap = new LinkedHashMap<>(); for (final NameValuePair pair : parameters) { final String keyString = pair.getName(); final String valueString = pair.getValue(); @@ -472,13 +472,13 @@ public class SmartUriAdapter { final IRI type = TypeDeterminer.determineType(decoded); if (type == XMLSchema.ANYURI) { if (keyString.equals(RYA_TYPES_URI.getLocalName())) { - entityTypeMap = convertUriToTypeMap(VF.createIRI(decoded)); + entityTypeMap = convertIriToTypeMap(VF.createIRI(decoded)); invertedEntityTypeMap = HashBiMap.create(entityTypeMap).inverse(); } } else { final int keyPrefixLocation = keyString.indexOf("."); final String keyPrefix = keyString.substring(0, keyPrefixLocation); - final RyaURI keyCorrespondingType = invertedEntityTypeMap.get(keyPrefix); + final RyaIRI keyCorrespondingType = invertedEntityTypeMap.get(keyPrefix); final String keyName = keyString.substring(keyPrefixLocation + 1, keyString.length()); final RyaType ryaType = new RyaType(type, valueString); @@ -577,9 +577,9 @@ public class SmartUriAdapter { public static Map<IRI, Value> entityToValueMap(final Entity entity) { final Map<IRI, Value> map = new LinkedHashMap<>(); - for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> entry : entity.getProperties().entrySet()) { - for (final Entry<RyaURI, Property> property : entry.getValue().entrySet()) { - final RyaURI propertyKey = property.getKey(); + for (final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> entry : entity.getProperties().entrySet()) { + for (final Entry<RyaIRI, Property> property : entry.getValue().entrySet()) { + final RyaIRI propertyKey = property.getKey(); final IRI iri = VF.createIRI(propertyKey.getData()); final Property propertyValue = property.getValue(); final Value value = RyaToRdfConversions.convertValue(propertyValue.getValue()); @@ -601,10 +601,10 @@ public class SmartUriAdapter { final IRI iri = entry.getKey(); final Value value = entry.getValue(); - final RyaURI ryaUri = new RyaURI(iri.stringValue()); + final RyaIRI ryaIri = new RyaIRI(iri.stringValue()); final RyaType ryaType = RdfToRyaConversions.convertValue(value); - final Property property = new Property(ryaUri, ryaType); + final Property property = new Property(ryaIri, ryaType); properties.add(property); } return properties; http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java index 03c2dbb..0c1650c 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java @@ -20,7 +20,7 @@ package org.apache.rya.indexing.smarturi; import java.util.Map; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.model.Type; import org.apache.rya.indexing.entity.model.TypedEntity; @@ -35,12 +35,12 @@ import org.eclipse.rdf4j.model.Value; public interface SmartUriStorage { /** * Stores the map into the datastore. - * @param subject the {@link RyaURI} subject of the Entity. Identifies the + * @param subject the {@link RyaIRI} subject of the Entity. Identifies the * thing that is being represented as an Entity. * @param map the {@link Map} of {@link IRI}s to {@link Value}s. * @throws SmartUriException */ - public void storeEntity(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException; + public void storeEntity(final RyaIRI subject, final Map<IRI, Value> map) throws SmartUriException; /** * Stores the entity into the datastore. @@ -59,12 +59,12 @@ public interface SmartUriStorage { /** * Queries for the entity based on the subject - * @param subject the {@link RyaURI} subject of the Entity. Identifies the + * @param subject the {@link RyaIRI} subject of the Entity. Identifies the * thing that is being represented as an Entity. * @return the {@link Entity} matching the subject. * @throws SmartUriException */ - public Entity queryEntity(final RyaURI subject) throws SmartUriException; + public Entity queryEntity(final RyaIRI subject) throws SmartUriException; /** * Queries the datastore for the map. http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java index 1d17097..6ac6ab2 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java @@ -36,7 +36,7 @@ import java.util.TreeSet; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.lang.StringUtils; import org.apache.rya.api.domain.RyaType; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.api.resolver.impl.DateTimeRyaTypeResolver; import org.apache.rya.indexing.entity.model.Entity; import org.apache.rya.indexing.entity.model.Property; @@ -251,16 +251,16 @@ public class DuplicateDataDetector { requireNonNull(entity2); boolean allValuesNearlyEqual = true; - final List<RyaURI> types1 = entity1.getExplicitTypeIds(); - final List<RyaURI> types2 = entity2.getExplicitTypeIds(); + final List<RyaIRI> types1 = entity1.getExplicitTypeIds(); + final List<RyaIRI> types2 = entity2.getExplicitTypeIds(); final boolean doBothHaveSameTypes = types1.containsAll(types2); if (!doBothHaveSameTypes) { return false; } - for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> entry : entity1.getProperties().entrySet()) { - final RyaURI typeIdUri = entry.getKey(); - for (final Entry<RyaURI, Property> typeProperty : entry.getValue().entrySet()) { - final RyaURI propertyNameUri = typeProperty.getKey(); + for (final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> entry : entity1.getProperties().entrySet()) { + final RyaIRI typeIdUri = entry.getKey(); + for (final Entry<RyaIRI, Property> typeProperty : entry.getValue().entrySet()) { + final RyaIRI propertyNameUri = typeProperty.getKey(); final Property property1 = typeProperty.getValue(); final Optional<Property> p2 = entity2.lookupTypeProperty(typeIdUri, propertyNameUri); http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java index 6571c83..8470a5d 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Set; import org.apache.rya.api.RdfCloudTripleStoreConfiguration; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.api.resolver.RdfToRyaConversions; import org.apache.rya.indexing.external.matching.ExternalSetProvider; import org.apache.rya.indexing.external.matching.QuerySegment; @@ -46,11 +46,11 @@ import com.google.common.collect.Multimap; */ public class StatementMetadataExternalSetProvider implements ExternalSetProvider<StatementMetadataNode<?>> { - private List<RyaURI> expectedURI = Arrays.asList(RdfToRyaConversions.convertURI(OWLReify.SOURCE), - RdfToRyaConversions.convertURI(OWLReify.PROPERTY), RdfToRyaConversions.convertURI(OWLReify.TARGET), - RdfToRyaConversions.convertURI(RDF.TYPE)); + private List<RyaIRI> expectedURI = Arrays.asList(RdfToRyaConversions.convertIRI(OWLReify.SOURCE), + RdfToRyaConversions.convertIRI(OWLReify.PROPERTY), RdfToRyaConversions.convertIRI(OWLReify.TARGET), + RdfToRyaConversions.convertIRI(RDF.TYPE)); private Multimap<Var, StatementPattern> reifiedQueries; - private Set<RyaURI> metadataProperties; + private Set<RyaIRI> metadataProperties; private RdfCloudTripleStoreConfiguration conf; public StatementMetadataExternalSetProvider(RdfCloudTripleStoreConfiguration conf) { @@ -102,7 +102,7 @@ public class StatementMetadataExternalSetProvider implements ExternalSetProvider for (StatementPattern pattern : patterns) { Var var = pattern.getPredicateVar(); if (var.getValue() != null && var.getValue() instanceof IRI) { - RyaURI uri = RdfToRyaConversions.convertURI((IRI) var.getValue()); + RyaIRI uri = RdfToRyaConversions.convertIRI((IRI) var.getValue()); if(expectedURI.contains(uri) || metadataProperties.contains(uri)) { finalPatterns.add(pattern); } http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java index 3d3b7ba..a5f8b3a 100644 --- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java +++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java @@ -39,7 +39,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration; import org.apache.rya.api.RdfCloudTripleStoreUtils; import org.apache.rya.api.domain.RyaStatement; import org.apache.rya.api.domain.RyaType; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.api.domain.StatementMetadata; import org.apache.rya.api.persist.RyaDAOException; import org.apache.rya.api.persist.query.RyaQueryEngine; @@ -104,16 +104,16 @@ import com.google.common.base.Preconditions; public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> extends ExternalSet implements ExternalBatchingIterator { - private static final RyaURI TYPE_ID_URI = new RyaURI(RDF.TYPE.toString()); - private static final RyaURI SUBJ_ID_URI = new RyaURI(OWLReify.SOURCE.toString()); - private static final RyaURI PRED_ID_URI = new RyaURI(OWLReify.PROPERTY.toString()); - private static final RyaURI OBJ_ID_URI = new RyaURI(OWLReify.TARGET.toString()); - private static final RyaURI STATEMENT_ID_URI = new RyaURI(OWLReify.ANNOTATION.toString()); + private static final RyaIRI TYPE_ID_URI = new RyaIRI(RDF.TYPE.toString()); + private static final RyaIRI SUBJ_ID_URI = new RyaIRI(OWLReify.SOURCE.toString()); + private static final RyaIRI PRED_ID_URI = new RyaIRI(OWLReify.PROPERTY.toString()); + private static final RyaIRI OBJ_ID_URI = new RyaIRI(OWLReify.TARGET.toString()); + private static final RyaIRI STATEMENT_ID_URI = new RyaIRI(OWLReify.ANNOTATION.toString()); private StatementPattern statement; - private Map<RyaURI, Var> properties; + private Map<RyaIRI, Var> properties; private Collection<StatementPattern> patterns; - private List<RyaURI> uriList = Arrays.asList(TYPE_ID_URI, SUBJ_ID_URI, PRED_ID_URI, OBJ_ID_URI); + private List<RyaIRI> uriList = Arrays.asList(TYPE_ID_URI, SUBJ_ID_URI, PRED_ID_URI, OBJ_ID_URI); private C conf; private Set<String> bindingNames; private RyaQueryEngine<C> queryEngine; @@ -206,7 +206,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e Var context = null; for (final StatementPattern pattern : patterns) { - final RyaURI predicate = new RyaURI(pattern.getPredicateVar().getValue().toString()); + final RyaIRI predicate = new RyaIRI(pattern.getPredicateVar().getValue().toString()); if (!contextSet) { context = pattern.getContextVar(); @@ -218,7 +218,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e } if (predicate.equals(TYPE_ID_URI)) { - final RyaURI statementID = new RyaURI(pattern.getObjectVar().getValue().stringValue()); + final RyaIRI statementID = new RyaIRI(pattern.getObjectVar().getValue().stringValue()); if (statementID.equals(STATEMENT_ID_URI)) { statementFound = true; } else { @@ -281,10 +281,10 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e private void setStatementPatternAndProperties(Collection<StatementPattern> patterns) { StatementPattern sp = new StatementPattern(); - Map<RyaURI, Var> properties = new HashMap<>(); + Map<RyaIRI, Var> properties = new HashMap<>(); for (final StatementPattern pattern : patterns) { - final RyaURI predicate = new RyaURI(pattern.getPredicateVar().getValue().toString()); + final RyaIRI predicate = new RyaIRI(pattern.getPredicateVar().getValue().toString()); if (!uriList.contains(predicate)) { Var objVar = pattern.getObjectVar(); @@ -355,19 +355,19 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e Value predValue = getVarValue(statement.getPredicateVar(), bs); Value objValue = getVarValue(statement.getObjectVar(), bs); Value contextValue = getVarValue(statement.getContextVar(), bs); - RyaURI subj = null; - RyaURI pred = null; + RyaIRI subj = null; + RyaIRI pred = null; RyaType obj = null; - RyaURI context = null; + RyaIRI context = null; if (subjValue != null) { Preconditions.checkArgument(subjValue instanceof IRI); - subj = RdfToRyaConversions.convertURI((IRI) subjValue); + subj = RdfToRyaConversions.convertIRI((IRI) subjValue); } if (predValue != null) { Preconditions.checkArgument(predValue instanceof IRI); - pred = RdfToRyaConversions.convertURI((IRI) predValue); + pred = RdfToRyaConversions.convertIRI((IRI) predValue); } if (objValue != null) { @@ -375,7 +375,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e } if(contextValue != null) { - context = RdfToRyaConversions.convertURI((IRI) contextValue); + context = RdfToRyaConversions.convertIRI((IRI) contextValue); } return new RyaStatement(subj, pred, obj, context); } @@ -480,7 +480,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e * This is an {@link CloseableIteration} class that serves a number of * purposes. It's primary purpose is to filter a CloseableIteration over * {@link Map.Entry<RyaStatement,BindingSet>} using a specified property Map - * from {@link RyaURI} to {@link org.eclipse.rdf4j.query.algebra.Var}. This + * from {@link RyaIRI} to {@link org.eclipse.rdf4j.query.algebra.Var}. This * Iteration iterates over the Entries in the user specified Iteration, * comparing properties in the {@link StatementMetadata} Map contained in * the RyaStatements with the property Map for this class. If the properties @@ -496,7 +496,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e class PropertyFilterAndBindingSetJoinIteration implements CloseableIteration<BindingSet, QueryEvaluationException> { private CloseableIteration<? extends Entry<RyaStatement, BindingSet>, RyaDAOException> statements; - private Map<RyaURI, Var> properties; + private Map<RyaIRI, Var> properties; private StatementPattern sp; private BindingSet next; private boolean hasNextCalled = false; @@ -504,7 +504,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e public PropertyFilterAndBindingSetJoinIteration( CloseableIteration<? extends Entry<RyaStatement, BindingSet>, RyaDAOException> statements, - Map<RyaURI, Var> properties, StatementPattern sp) { + Map<RyaIRI, Var> properties, StatementPattern sp) { this.statements = statements; this.properties = properties; this.sp = sp; @@ -631,13 +631,13 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e */ private Optional<BindingSet> buildPropertyBindingSet(RyaStatement statement) { StatementMetadata metadata = statement.getMetadata(); - Map<RyaURI, RyaType> statementProps = metadata.getMetadata(); + Map<RyaIRI, RyaType> statementProps = metadata.getMetadata(); if (statementProps.size() < properties.size()) { return Optional.empty(); } QueryBindingSet bs = new QueryBindingSet(); - for (Map.Entry<RyaURI, Var> entry : properties.entrySet()) { - RyaURI key = entry.getKey(); + for (Map.Entry<RyaIRI, Var> entry : properties.entrySet()) { + RyaIRI key = entry.getKey(); Var var = entry.getValue(); if (!statementProps.containsKey(key)) { return Optional.empty(); http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java b/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java index 7108ae6..02ed887 100644 --- a/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java +++ b/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java @@ -41,7 +41,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration; import org.apache.rya.accumulo.RyaTableMutationsFactory; import org.apache.rya.api.domain.RyaStatement; import org.apache.rya.api.domain.RyaType; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.apache.rya.api.resolver.RdfToRyaConversions; import org.apache.rya.api.resolver.RyaContext; import org.apache.rya.api.resolver.RyaToRdfConversions; @@ -1705,14 +1705,14 @@ public class DocumentIndexIntersectingIteratorTest { for (int i = 0; i < 20; i++) { - RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1")); - RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2")); + RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1")); + RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2")); RyaStatement rs3 = null; RyaStatement rs4 = null; if(i == 5 || i == 15) { - rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i))); - rs4 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.STRING,Integer.toString(i))); + rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i))); + rs4 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.STRING,Integer.toString(i))); } @@ -1780,9 +1780,9 @@ public class DocumentIndexIntersectingIteratorTest { RyaType rt1 = RdfToRyaConversions.convertValue(spList1.get(2).getObjectVar().getValue()); RyaType rt2 = RdfToRyaConversions.convertValue(spList2.get(2).getObjectVar().getValue()); - RyaURI predURI1 = (RyaURI) RdfToRyaConversions.convertValue(spList1.get(0).getPredicateVar().getValue()); - RyaURI predURI2 = (RyaURI) RdfToRyaConversions.convertValue(spList1.get(1).getPredicateVar().getValue()); - RyaURI predURI3 = (RyaURI) RdfToRyaConversions.convertValue(spList1.get(2).getPredicateVar().getValue()); + RyaIRI predURI1 = (RyaIRI) RdfToRyaConversions.convertValue(spList1.get(0).getPredicateVar().getValue()); + RyaIRI predURI2 = (RyaIRI) RdfToRyaConversions.convertValue(spList1.get(1).getPredicateVar().getValue()); + RyaIRI predURI3 = (RyaIRI) RdfToRyaConversions.convertValue(spList1.get(2).getPredicateVar().getValue()); // System.out.println("to string" + spList1.get(2).getObjectVar().getValue().stringValue()); // System.out.println("converted obj" + rt1.getData()); http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java ---------------------------------------------------------------------- diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java index fcef816..d605fcd 100644 --- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java +++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java @@ -30,7 +30,7 @@ import java.util.Properties; import java.util.Set; import org.apache.accumulo.core.security.Authorizations; -import org.apache.rya.api.domain.RyaURI; +import org.apache.rya.api.domain.RyaIRI; import org.junit.Test; public class AccumuloIndexingConfigurationTest { @@ -114,7 +114,7 @@ public class AccumuloIndexingConfigurationTest { boolean useInference = true; boolean displayPlan = false; boolean useMetadata = true; - Set<RyaURI> metaProperties = new HashSet<>(Arrays.asList(new RyaURI("urn:123"), new RyaURI("urn:456"))); + Set<RyaIRI> metaProperties = new HashSet<>(Arrays.asList(new RyaIRI("urn:123"), new RyaIRI("urn:456"))); Properties props = new Properties();