[ 
https://issues.apache.org/jira/browse/RYA-250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16122459#comment-16122459
 ] 

ASF GitHub Bot commented on RYA-250:
------------------------------------

Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/153#discussion_r132571187
  
    --- Diff: 
extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java
 ---
    @@ -242,4 +282,49 @@ private static Bson makeExplicitTypeFilter(final 
RyaURI typeId) {
     
             return Stream.of(dataTypeFilter, valueFilter);
         }
    +
    +    private boolean detectDuplicates(final Entity entity) throws 
EntityStorageException {
    +        boolean hasDuplicate = false;
    +        if (duplicateDataDetector.isDetectionEnabled()) {
    +            if (mongoTypeStorage == null) {
    +                mongoTypeStorage = new MongoTypeStorage(mongo, 
ryaInstanceName);
    +            }
    +            final Builder builder = new Builder();
    +            builder.setSubject(entity.getSubject());
    +            boolean abort = false;
    +            for (final RyaURI typeRyaUri : entity.getExplicitTypeIds()) {
    +                final ImmutableMap<RyaURI, Property> typePropertyMap = 
entity.getProperties().get(typeRyaUri);
    +                final Set<Property> properties = new 
HashSet<>(typePropertyMap.values());
    +                Optional<Type> type;
    +                try {
    +                    type = mongoTypeStorage.get(typeRyaUri);
    +                } catch (final TypeStorageException e) {
    +                    throw new EntityStorageException("Unable to get entity 
type: " + typeRyaUri, e);
    +                }
    +                if (type.isPresent()) {
    +                    //final ConvertingCursor<TypedEntity> cursor = 
search(Optional.empty(), type.get(), properties);
    --- End diff --
    
    commented code


> Smart URI avoid data duplication
> --------------------------------
>
>                 Key: RYA-250
>                 URL: https://issues.apache.org/jira/browse/RYA-250
>             Project: Rya
>          Issue Type: Task
>          Components: dao
>    Affects Versions: 3.2.10
>            Reporter: Eric White
>            Assignee: Eric White
>             Fix For: 3.2.10
>
>
> Implement Smart URI methods for avoiding data duplication.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to