HerculesCRUE_Commons-ED-MA/src/Hercules.CommonsEDMA.ServicioExterno/Hercules.CommonsEDMA.ServicioExterno/Models/ClusterOntology/Cluster.cs
using System;
using System.Collections.Generic;
using Gnoss.ApiWrapper;
using Gnoss.ApiWrapper.Model;
using GnossBase;
using System.Text.RegularExpressions;
using System.Collections;
using System.Diagnostics.CodeAnalysis;

namespace ClusterOntology
{
    [ExcludeFromCodeCoverage]
    public class Cluster : GnossOCBase
    {

        public Cluster() : base() { }
        public virtual string RdfType { get { return "http://w3id.org/roh/Cluster"; } }
        public virtual string RdfsLabel { get { return "http://w3id.org/roh/Cluster"; } }
        [LABEL(LanguageEnum.es, "http://www.w3.org/1999/02/22-rdf-syntax-ns#member")]
        [RDFProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#member")]
        public string IdRdf_member { get; set; }

        [RDFProperty("http://w3id.org/roh/clusterPerfil")]
        public List<ClusterPerfil> Roh_clusterPerfil { get; set; }

        [RDFProperty("http://w3id.org/roh/hasKnowledgeArea")]
        public List<CategoryPath> Roh_hasKnowledgeArea { get; set; }

        [RDFProperty("http://vivoweb.org/ontology/core#description")]
        public string Vivo_description { get; set; }

        [RDFProperty("http://purl.org/dc/terms/issued")]
        public DateTime Dct_issued { get; set; }

        [RDFProperty("http://w3id.org/roh/title")]
        public string Roh_title { get; set; }


        internal override void GetProperties()
        {
            base.GetProperties();
            propList.Add(new StringOntologyProperty("rdf:member", this.IdRdf_member));
            propList.Add(new StringOntologyProperty("vivo:description", this.Vivo_description));
            propList.Add(new DateOntologyProperty("dct:issued", this.Dct_issued));
            propList.Add(new StringOntologyProperty("roh:title", this.Roh_title));
        }

        internal override void GetEntities()
        {
            base.GetEntities();
            if (Roh_clusterPerfil != null)
            {
                foreach (ClusterPerfil prop in Roh_clusterPerfil)
                {
                    prop.GetProperties();
                    prop.GetEntities();
                    OntologyEntity entityClusterPerfil = new("http://w3id.org/roh/ClusterPerfil", "http://w3id.org/roh/ClusterPerfil", "roh:clusterPerfil", prop.propList, prop.entList);
                    entList.Add(entityClusterPerfil);
                    prop.Entity = entityClusterPerfil;
                }
            }
            if (Roh_hasKnowledgeArea != null)
            {
                foreach (CategoryPath prop in Roh_hasKnowledgeArea)
                {
                    prop.GetProperties();
                    prop.GetEntities();
                    OntologyEntity entityCategoryPath = new("http://w3id.org/roh/CategoryPath", "http://w3id.org/roh/CategoryPath", "roh:hasKnowledgeArea", prop.propList, prop.entList);
                    entList.Add(entityCategoryPath);
                    prop.Entity = entityCategoryPath;
                }
            }
        }
        public virtual ComplexOntologyResource ToGnossApiResource(ResourceApi resourceAPI, List<string> listaDeCategorias)
        {
            return ToGnossApiResource(resourceAPI, listaDeCategorias, Guid.Empty, Guid.Empty);
        }

        public virtual ComplexOntologyResource ToGnossApiResource(ResourceApi resourceAPI, List<string> listaDeCategorias, Guid idrecurso, Guid idarticulo)
        {
            ComplexOntologyResource resource = new();
            Ontology ontology = null;
            GetEntities();
            GetProperties();
            if (idrecurso.Equals(Guid.Empty) && idarticulo.Equals(Guid.Empty))
            {
                ontology = new Ontology(resourceAPI.GraphsUrl, resourceAPI.OntologyUrl, RdfType, RdfsLabel, prefList, propList, entList);
            }
            else
            {
                ontology = new Ontology(resourceAPI.GraphsUrl, resourceAPI.OntologyUrl, RdfType, RdfsLabel, prefList, propList, entList, idrecurso, idarticulo);
            }
            resource.Id = GNOSSID;
            resource.Ontology = ontology;
            resource.TextCategories = listaDeCategorias;
            AddResourceTitle(resource);
            AddResourceDescription(resource);
            return resource;
        }

        public override List<string> ToOntologyGnossTriples(ResourceApi resourceAPI)
        {
            List<string> list = new();
            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", $"<http://w3id.org/roh/Cluster>", list, " . ");
            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}", "http://www.w3.org/2000/01/rdf-schema#label", $"\"http://w3id.org/roh/Cluster\"", list, " . ");
            AgregarTripleALista($"{resourceAPI.GraphsUrl}{ResourceID}", "http://gnoss/hasEntidad", $"<{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}>", list, " . ");
            if (this.Roh_clusterPerfil != null)
            {
                foreach (var item0 in this.Roh_clusterPerfil)
                {
                    AgregarTripleALista($"{resourceAPI.GraphsUrl}items/ClusterPerfil_{ResourceID}_{item0.ArticleID}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", $"<http://w3id.org/roh/ClusterPerfil>", list, " . ");
                    AgregarTripleALista($"{resourceAPI.GraphsUrl}items/ClusterPerfil_{ResourceID}_{item0.ArticleID}", "http://www.w3.org/2000/01/rdf-schema#label", $"\"http://w3id.org/roh/ClusterPerfil\"", list, " . ");
                    AgregarTripleALista($"{resourceAPI.GraphsUrl}{ResourceID}", "http://gnoss/hasEntidad", $"<{resourceAPI.GraphsUrl}items/ClusterPerfil_{ResourceID}_{item0.ArticleID}>", list, " . ");
                    AgregarTripleALista($"{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}", "http://w3id.org/roh/clusterPerfil", $"<{resourceAPI.GraphsUrl}items/ClusterPerfil_{ResourceID}_{item0.ArticleID}>", list, " . ");
                    if (item0.Roh_hasKnowledgeArea != null)
                    {
                        foreach (var item1 in item0.Roh_hasKnowledgeArea)
                        {
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item1.ArticleID}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", $"<http://w3id.org/roh/CategoryPath>", list, " . ");
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item1.ArticleID}", "http://www.w3.org/2000/01/rdf-schema#label", $"\"http://w3id.org/roh/CategoryPath\"", list, " . ");
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}{ResourceID}", "http://gnoss/hasEntidad", $"<{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item1.ArticleID}>", list, " . ");
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/ClusterPerfil_{ResourceID}_{item0.ArticleID}", "http://w3id.org/roh/hasKnowledgeArea", $"<{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item1.ArticleID}>", list, " . ");
                            if (item1.IdsRoh_categoryNode != null)
                            {
                                foreach (var item2 in item1.IdsRoh_categoryNode)
                                {
                                    AgregarTripleALista($"{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item1.ArticleID}", "http://w3id.org/roh/categoryNode", $"<{item2}>", list, " . ");
                                }
                            }
                        }
                    }
                    if (item0.IdsRdf_member != null)
                    {
                        foreach (var item2 in item0.IdsRdf_member)
                        {
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/ClusterPerfil_{ResourceID}_{item0.ArticleID}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#member", $"<{item2}>", list, " . ");
                        }
                    }
                    if (item0.Vivo_freeTextKeyword != null)
                    {
                        foreach (var item2 in item0.Vivo_freeTextKeyword)
                        {
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/ClusterPerfil_{ResourceID}_{item0.ArticleID}", "http://vivoweb.org/ontology/core#freeTextKeyword", $"\"{GenerarTextoSinSaltoDeLinea(item2)}\"", list, " . ");
                        }
                    }
                    if (item0.Roh_title != null)
                    {
                        AgregarTripleALista($"{resourceAPI.GraphsUrl}items/ClusterPerfil_{ResourceID}_{item0.ArticleID}", "http://w3id.org/roh/title", $"\"{GenerarTextoSinSaltoDeLinea(item0.Roh_title)}\"", list, " . ");
                    }
                }
            }
            if (this.Roh_hasKnowledgeArea != null)
            {
                foreach (var item0 in this.Roh_hasKnowledgeArea)
                {
                    AgregarTripleALista($"{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item0.ArticleID}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", $"<http://w3id.org/roh/CategoryPath>", list, " . ");
                    AgregarTripleALista($"{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item0.ArticleID}", "http://www.w3.org/2000/01/rdf-schema#label", $"\"http://w3id.org/roh/CategoryPath\"", list, " . ");
                    AgregarTripleALista($"{resourceAPI.GraphsUrl}{ResourceID}", "http://gnoss/hasEntidad", $"<{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item0.ArticleID}>", list, " . ");
                    AgregarTripleALista($"{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}", "http://w3id.org/roh/hasKnowledgeArea", $"<{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item0.ArticleID}>", list, " . ");
                    if (item0.IdsRoh_categoryNode != null)
                    {
                        foreach (var item2 in item0.IdsRoh_categoryNode)
                        {
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/CategoryPath_{ResourceID}_{item0.ArticleID}", "http://w3id.org/roh/categoryNode", $"<{item2}>", list, " . ");
                        }
                    }
                }
            }
            if (this.IdRdf_member != null)
            {
                AgregarTripleALista($"{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#member", $"<{this.IdRdf_member}>", list, " . ");
            }
            if (this.Vivo_description != null)
            {
                AgregarTripleALista($"{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}", "http://vivoweb.org/ontology/core#description", $"\"{GenerarTextoSinSaltoDeLinea(this.Vivo_description)}\"", list, " . ");
            }
            if (this.Dct_issued != null)
            {
                AgregarTripleALista($"{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}", "http://purl.org/dc/terms/issued", $"\"{this.Dct_issued.ToString("yyyyMMddHHmmss")}\"", list, " . ");
            }
            if (this.Roh_title != null)
            {
                AgregarTripleALista($"{resourceAPI.GraphsUrl}items/Cluster_{ResourceID}_{ArticleID}", "http://w3id.org/roh/title", $"\"{GenerarTextoSinSaltoDeLinea(this.Roh_title)}\"", list, " . ");
            }
            return list;
        }

        public override List<string> ToSearchGraphTriples(ResourceApi resourceAPI)
        {
            List<string> list = new();
            List<string> listaSearch = new();
            AgregarTags(list);
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", $"\"cluster\"", list, " . ");
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://gnoss/type", $"\"http://w3id.org/roh/Cluster\"", list, " . ");
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://gnoss/hasfechapublicacion", $"{DateTime.Now.ToString("yyyyMMddHHmmss")}", list, " . ");
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://gnoss/hastipodoc", "\"5\"", list, " . ");
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://gnoss/hasfechamodificacion", $"{DateTime.Now.ToString("yyyyMMddHHmmss")}", list, " . ");
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://gnoss/hasnumeroVisitas", "0", list, " . ");
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://gnoss/hasprivacidadCom", "\"publico\"", list, " . ");
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://xmlns.com/foaf/0.1/firstName", $"\"{GenerarTextoSinSaltoDeLinea(this.Roh_title)}\"", list, " . ");
            AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://gnoss/hasnombrecompleto", $"\"{GenerarTextoSinSaltoDeLinea(this.Roh_title)}\"", list, " . ");
            string search = string.Empty;
            if (this.Roh_clusterPerfil != null)
            {
                foreach (var item0 in this.Roh_clusterPerfil)
                {
                    AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://w3id.org/roh/clusterPerfil", $"<{resourceAPI.GraphsUrl}items/clusterperfil_{ResourceID}_{item0.ArticleID}>", list, " . ");
                    if (item0.Roh_hasKnowledgeArea != null)
                    {
                        foreach (var item1 in item0.Roh_hasKnowledgeArea)
                        {
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/clusterperfil_{ResourceID}_{item0.ArticleID}", "http://w3id.org/roh/hasKnowledgeArea", $"<{resourceAPI.GraphsUrl}items/categorypath_{ResourceID}_{item1.ArticleID}>", list, " . ");
                            if (item1.IdsRoh_categoryNode != null)
                            {
                                foreach (var item2 in item1.IdsRoh_categoryNode)
                                {
                                    Regex regex = new(@"\/items\/.+_[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}_[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}");
                                    string itemRegex = item2;
                                    if (regex.IsMatch(itemRegex))
                                    {
                                        itemRegex = $"http://gnoss/{resourceAPI.GetShortGuid(itemRegex).ToString().ToUpper()}";
                                    }
                                    else
                                    {
                                        itemRegex = itemRegex.ToLower();
                                    }
                                    AgregarTripleALista($"{resourceAPI.GraphsUrl}items/categorypath_{ResourceID}_{item1.ArticleID}", "http://w3id.org/roh/categoryNode", $"<{itemRegex}>", list, " . ");
                                }
                            }
                        }
                    }
                    if (item0.IdsRdf_member != null)
                    {
                        foreach (var item2 in item0.IdsRdf_member)
                        {
                            Regex regex = new(@"\/items\/.+_[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}_[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}");
                            string itemRegex = item2;
                            if (regex.IsMatch(itemRegex))
                            {
                                itemRegex = $"http://gnoss/{resourceAPI.GetShortGuid(itemRegex).ToString().ToUpper()}";
                            }
                            else
                            {
                                itemRegex = itemRegex.ToLower();
                            }
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/clusterperfil_{ResourceID}_{item0.ArticleID}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#member", $"<{itemRegex}>", list, " . ");
                        }
                    }
                    if (item0.Vivo_freeTextKeyword != null)
                    {
                        foreach (var item2 in item0.Vivo_freeTextKeyword)
                        {
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/clusterperfil_{ResourceID}_{item0.ArticleID}", "http://vivoweb.org/ontology/core#freeTextKeyword", $"\"{GenerarTextoSinSaltoDeLinea(item2).ToLower()}\"", list, " . ");
                        }
                    }
                    if (item0.Roh_title != null)
                    {
                        AgregarTripleALista($"{resourceAPI.GraphsUrl}items/clusterperfil_{ResourceID}_{item0.ArticleID}", "http://w3id.org/roh/title", $"\"{GenerarTextoSinSaltoDeLinea(item0.Roh_title).ToLower()}\"", list, " . ");
                    }
                }
            }
            if (this.Roh_hasKnowledgeArea != null)
            {
                foreach (var item0 in this.Roh_hasKnowledgeArea)
                {
                    AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://w3id.org/roh/hasKnowledgeArea", $"<{resourceAPI.GraphsUrl}items/categorypath_{ResourceID}_{item0.ArticleID}>", list, " . ");
                    if (item0.IdsRoh_categoryNode != null)
                    {
                        foreach (var item2 in item0.IdsRoh_categoryNode)
                        {
                            Regex regex = new(@"\/items\/.+_[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}_[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}");
                            string itemRegex = item2;
                            if (regex.IsMatch(itemRegex))
                            {
                                itemRegex = $"http://gnoss/{resourceAPI.GetShortGuid(itemRegex).ToString().ToUpper()}";
                            }
                            else
                            {
                                itemRegex = itemRegex.ToLower();
                            }
                            AgregarTripleALista($"{resourceAPI.GraphsUrl}items/categorypath_{ResourceID}_{item0.ArticleID}", "http://w3id.org/roh/categoryNode", $"<{itemRegex}>", list, " . ");
                        }
                    }
                }
            }
            if (this.IdRdf_member != null)
            {
                Regex regex = new(@"\/items\/.+_[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}_[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}");
                string itemRegex = this.IdRdf_member;
                if (regex.IsMatch(itemRegex))
                {
                    itemRegex = $"http://gnoss/{resourceAPI.GetShortGuid(itemRegex).ToString().ToUpper()}";
                }
                else
                {
                    itemRegex = itemRegex.ToLower();
                }
                AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://www.w3.org/1999/02/22-rdf-syntax-ns#member", $"<{itemRegex}>", list, " . ");
            }
            if (this.Vivo_description != null)
            {
                AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://vivoweb.org/ontology/core#description", $"\"{GenerarTextoSinSaltoDeLinea(this.Vivo_description).ToLower()}\"", list, " . ");
            }
            if (this.Dct_issued != null)
            {
                AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://purl.org/dc/terms/issued", $"{this.Dct_issued.ToString("yyyyMMddHHmmss")}", list, " . ");
            }
            if (this.Roh_title != null)
            {
                AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://w3id.org/roh/title", $"\"{GenerarTextoSinSaltoDeLinea(this.Roh_title).ToLower()}\"", list, " . ");
            }
            if (listaSearch != null && listaSearch.Count > 0)
            {
                foreach (string valorSearch in listaSearch)
                {
                    search += $"{valorSearch} ";
                }
            }
            if (!string.IsNullOrEmpty(search))
            {
                AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://gnoss/search", $"\"{GenerarTextoSinSaltoDeLinea(search.ToLower())}\"", list, " . ");
            }
            return list;
        }

        public override KeyValuePair<Guid, string> ToAcidData(ResourceApi resourceAPI)
        {

            //Insert en la tabla Documento
            string tags = "";
            foreach (string tag in tagList)
            {
                tags += $"{tag}, ";
            }
            if (!string.IsNullOrEmpty(tags))
            {
                tags = tags.Substring(0, tags.LastIndexOf(','));
            }
            string titulo = $"{this.Roh_title.Replace("\r\n", "").Replace("\n", "").Replace("\r", "").Replace("\"", "\"\"").Replace("'", "''").Replace("|", "#PIPE#")}";
            string descripcion = $"{this.Roh_title.Replace("\r\n", "").Replace("\n", "").Replace("\r", "").Replace("\"", "\"\"").Replace("'", "''").Replace("|", "#PIPE#")}";
            string tablaDoc = $"'{titulo}', '{descripcion}', '{resourceAPI.GraphsUrl}', '{tags}'";
            KeyValuePair<Guid, string> valor = new(ResourceID, tablaDoc);

            return valor;
        }

        protected List<object> ObtenerObjetosDePropiedad(object propiedad)
        {
            List<object> lista = new();
            if (propiedad is IList)
            {
                foreach (object item in (IList)propiedad)
                {
                    lista.Add(item);
                }
            }
            else
            {
                lista.Add(propiedad);
            }
            return lista;
        }
        protected List<string> ObtenerStringDePropiedad(object propiedad)
        {
            List<string> lista = new();
            if (propiedad is IList)
            {
                foreach (string item in (IList)propiedad)
                {
                    lista.Add(item);
                }
            }
            else if (propiedad is IDictionary)
            {
                foreach (object key in ((IDictionary)propiedad).Keys)
                {
                    if (((IDictionary)propiedad)[key] is IList)
                    {
                        List<string> listaValores = (List<string>)((IDictionary)propiedad)[key];
                        foreach (string valor in listaValores)
                        {
                            lista.Add(valor);
                        }
                    }
                    else
                    {
                        lista.Add((string)((IDictionary)propiedad)[key]);
                    }
                }
            }
            else if (propiedad is string)
            {
                lista.Add((string)propiedad);
            }
            return lista;
        }
        public override string GetURI(ResourceApi resourceAPI)
        {
            return $"{resourceAPI.GraphsUrl}items/ClusterOntology_{ResourceID}_{ArticleID}";
        }

        private static string GenerarTextoSinSaltoDeLinea(string pTexto)
        {
            return pTexto.Replace("\r\n", " ").Replace("\n", " ").Replace("\r", " ").Replace("\"", "\\\"");
        }

        internal void AddResourceTitle(ComplexOntologyResource resource)
        {
            resource.Title = this.Roh_title;
        }

        internal void AddResourceDescription(ComplexOntologyResource resource)
        {
            resource.Description = this.Roh_title;
        }

        private static void AgregarTripleALista(string pSujeto, string pPredicado, string pObjeto, List<string> pLista, string pDatosExtra)
        {
            if (!string.IsNullOrEmpty(pObjeto) && !pObjeto.Equals("\"\"") && !pObjeto.Equals("<>"))
            {
                pLista.Add($"<{pSujeto}> <{pPredicado}> {pObjeto}{pDatosExtra}");
            }
        }

        private void AgregarTags(List<string> pListaTriples)
        {
            foreach (string tag in tagList)
            {
                AgregarTripleALista($"http://gnoss/{ResourceID.ToString().ToUpper()}", "http://rdfs.org/sioc/types#Tag", tag.ToLower(), pListaTriples, " . ");
            }
        }


    }
}
