<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using Castle.Core.Internal;
using LinkedData.Concepts;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Links;
using VDS.RDF;
using VDS.RDF.Parsing;
using VDS.RDF.Query;

namespace LinkedData.Helpers
{
    public static class SitecoreTripleHelper
    {
        public static Uri BrokenLinkUri = new Uri("sitecore://broken-link");

        public static List<SitecoreTriple> ToSitecoreTriples(this IEnumerable<Triple> triples)
        {<commit_msg>Added helper to convert INode to SitecoreNode<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using Castle.Core.Internal;
using LinkedData.Concepts;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Links;
using VDS.RDF;
using VDS.RDF.Parsing;
using VDS.RDF.Query;

namespace LinkedData.Helpers
{
    public static class SitecoreTripleHelper
    {
        public static Uri BrokenLinkUri = new Uri("sitecore://broken-link");

        public static SitecoreNode ToSitecoreNode(this INode node)
        {
            var sitecoreNode = new SitecoreNode(node);

            if (sitecoreNode.Item == null)
            {
                return null;
            }
            return sitecoreNode;
        }

        public static List<SitecoreTriple> ToSitecoreTriples(this IEnumerable<Triple> triples)
        {
{'fraction_non_alphanumeric': 0.08442004118050789, 'fraction_numerical': 0.0, 'mean_word_length': 3.3783783783783785, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4217432', 'n_tokens_mistral': 438, 'n_tokens_neox': 430, 'n_words': 107}