Ejemplo n.º 1
0
        public ulong GetTripleCount(string predicateUri, BrightstarProfiler profiler = null)
        {
            var predicateId = _resourceIndex.GetResourceId(_prefixManager.MakePrefixedUri(predicateUri));

            if (predicateId == StoreConstants.NullUlong)
            {
                return(0L);
            }
            return(_subjectRelatedResourceIndex.CountPredicateRelationships(predicateId, profiler));
        }
Ejemplo n.º 2
0
 private ulong FindResourceId(string resourceValue, bool isLiteral = false, string dataType = null,
                              string langCode = null)
 {
     if (resourceValue == null)
     {
         return(StoreConstants.NullUlong);
     }
     if (!isLiteral)
     {
         try
         {
             resourceValue = new Uri(resourceValue, UriKind.Absolute).ToString();
         }
         catch (FormatException)
         {
             throw new InvalidTripleException(
                       String.Format("The string '{0}' could not be parsed as a valid URI.", resourceValue));
         }
         resourceValue = _prefixManager.MakePrefixedUri(resourceValue);
     }
     return(_resourceIndex.GetResourceId(resourceValue, isLiteral, dataType, langCode, !isLiteral));
 }