Example #1
0
        public static List <ItemLink> TriplesToItemLinks(IEnumerable <Triple> triples)
        {
            var list = new List <ItemLink>();

            foreach (var triple in triples)
            {
                var sourceItem = SitecoreTripleHelper.UriToItem(triple.Subject.ToString());
                var targetItem = SitecoreTripleHelper.UriToItem(triple.Object.ToString());

                if (sourceItem != null && targetItem != null)
                {
                    list.Add(new ItemLink(sourceItem.Database.Name, sourceItem.ID,
                                          SitecoreTripleHelper.GetFieldIdFromPredicate(triple.Predicate),
                                          targetItem.Database.Name, targetItem.ID,
                                          targetItem.Paths.FullPath));
                }
            }

            return(list);
        }
Example #2
0
 public static ID GetFieldIdFromPredicate(INode predicateNode)
 {
     return(new ID(SitecoreTripleHelper.GetFieldIdFromPredicate(predicateNode.ToString())));
 }