private void RenderLink(StringBuilder result, SitecoreTriple triple, bool refferences)
        {
            Item item = refferences ? triple.ObjectNode.Item : triple.SubjectNode.Item;

            if (IsHidden(item) && !UserOptions.View.ShowHiddenItems)
            {
                return;
            }

            if (item == null)
            {
                result.Append(string.Format("<div class=\"scLink\">{0} {1}: {2}, {3}</div>",
                                            (object)Images.GetImage("Applications/16x16/error.png", 16, 16, "absmiddle", "0px 4px 0px 0px"),
                                            (object)Translate.Text("Not found"), "TODO: Target database for link", "TODO: Target broken link ID"));
            }
            else
            {
                result.Append("<a href=\"#\" class=\"scLink\" onclick='javascript:return scForm.invoke(\"item:load(id=" +
                              (object)item.ID + ",language=" + item.Language.ToString() + ",version=" + item.Version.ToString() + ")\")'>" +
                              Images.GetImage(item.Appearance.Icon, 16, 16, "absmiddle", "0px 4px 0px 0px") +
                              item.DisplayName);


                if (!SitecoreTripleHelper.GetFieldIdFromPredicate(triple.PredicateNode).IsNull)
                {
                    var linkField = triple.SubjectNode.Item.Fields[SitecoreTripleHelper.GetFieldIdFromPredicate(triple.PredicateNode)];

                    if (linkField != null)
                    {
                        if (!string.IsNullOrEmpty(linkField.DisplayName))
                        {
                            result.Append(" - ");
                            result.Append(linkField.DisplayName);

                            if (!linkField.HasValue)
                            {
                                result.Append(" <span style=\"color:#999999\">");
                                result.Append(Translate.Text("[inherited]"));
                                result.Append("</span>");
                            }
                        }
                    }
                }

                result.Append(" - [" + item.Paths.Path + "]</a>");
            }
        }
        public override ItemLink[] GetBrokenLinks(Database database)
        {
            Assert.ArgumentNotNull((object)database, "database");

            var manager = _factory.GetContextLinkDatabaseDataManager(database);

            var query = @"CONSTRUCT {{ ?s ?p <{0}> }} WHERE {{ ?s ?p <{0}> }}";

            query = String.Format(query, SitecoreTripleHelper.BrokenLinkUri.ToString());

            var triples = manager.TripleQuery(query);

            var links = new List <ItemLink>();

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

                if (sourceItem != null)
                {
                    links.Add(new ItemLink(sourceItem.Database.Name, sourceItem.ID, sourceItem.Language, sourceItem.Version, SitecoreTripleHelper.GetFieldIdFromPredicate(triple.Predicate), sourceItem.Database.Name, new ID(Guid.Empty), sourceItem.Language, sourceItem.Version, string.Empty));
                }

                Job job = Context.Job;
                if (job != null && job.Category == "GetBrokenLinks")
                {
                    ++job.Status.Processed;
                }
                LinkCounters.DataRead.Increment();
                DataCounters.PhysicalReads.Increment();
            }


            return(links.ToArray());
        }