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)); }
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)); }