Esempio n. 1
0
 public Rating(SemanticEntityModel pSemCmsModel, LanguageEnum idiomaUsuario) : base()
 {
     this.mGNOSSID            = pSemCmsModel.Entity.Uri;
     this.mURL                = pSemCmsModel.Properties.FirstOrDefault(p => p.PropertyValues.Any(prop => prop.DownloadUrl != null))?.FirstPropertyValue.DownloadUrl;
     this.Schema_ratingSource = GetPropertyValueSemCms(pSemCmsModel.GetPropertyByPath("http://schema.org/ratingSource"));
     this.Schema_ratingValue  = GetNumberIntPropertyValueSemCms(pSemCmsModel.GetPropertyByPath("http://schema.org/ratingValue")).Value;
 }
Esempio n. 2
0
        public Movie(SemanticEntityModel pSemCmsModel, LanguageEnum idiomaUsuario) : base()
        {
            this.mGNOSSID      = pSemCmsModel.Entity.Uri;
            this.mURL          = pSemCmsModel.Properties.FirstOrDefault(p => p.PropertyValues.Any(prop => prop.DownloadUrl != null))?.FirstPropertyValue.DownloadUrl;
            this.Schema_author = new List <Person>();
            SemanticPropertyModel propSchema_author = pSemCmsModel.GetPropertyByPath("http://schema.org/author");

            if (propSchema_author != null && propSchema_author.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_author.PropertyValues)
                {
                    if (propValue.RelatedEntity != null)
                    {
                        Person schema_author = new Person(propValue.RelatedEntity, idiomaUsuario);
                        this.Schema_author.Add(schema_author);
                    }
                }
            }
            this.Schema_rating = new List <Rating>();
            SemanticPropertyModel propSchema_rating = pSemCmsModel.GetPropertyByPath("http://schema.org/rating");

            if (propSchema_rating != null && propSchema_rating.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_rating.PropertyValues)
                {
                    if (propValue.RelatedEntity != null)
                    {
                        Rating schema_rating = new Rating(propValue.RelatedEntity, idiomaUsuario);
                        this.Schema_rating.Add(schema_rating);
                    }
                }
            }
            this.Schema_director = new List <Person>();
            SemanticPropertyModel propSchema_director = pSemCmsModel.GetPropertyByPath("http://schema.org/director");

            if (propSchema_director != null && propSchema_director.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_director.PropertyValues)
                {
                    if (propValue.RelatedEntity != null)
                    {
                        Person schema_director = new Person(propValue.RelatedEntity, idiomaUsuario);
                        this.Schema_director.Add(schema_director);
                    }
                }
            }
            this.Schema_actor = new List <Person>();
            SemanticPropertyModel propSchema_actor = pSemCmsModel.GetPropertyByPath("http://schema.org/actor");

            if (propSchema_actor != null && propSchema_actor.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_actor.PropertyValues)
                {
                    if (propValue.RelatedEntity != null)
                    {
                        Person schema_actor = new Person(propValue.RelatedEntity, idiomaUsuario);
                        this.Schema_actor.Add(schema_actor);
                    }
                }
            }
            SemanticPropertyModel propSchema_genre = pSemCmsModel.GetPropertyByPath("http://schema.org/genre");

            this.Schema_genre = new List <string>();
            if (propSchema_genre != null && propSchema_genre.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_genre.PropertyValues)
                {
                    this.Schema_genre.Add(propValue.Value);
                }
            }
            SemanticPropertyModel propSchema_url = pSemCmsModel.GetPropertyByPath("http://schema.org/url");

            this.Schema_url = new List <string>();
            if (propSchema_url != null && propSchema_url.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_url.PropertyValues)
                {
                    this.Schema_url.Add(propValue.Value);
                }
            }
            SemanticPropertyModel propSchema_aggregateRating = pSemCmsModel.GetPropertyByPath("http://schema.org/aggregateRating");

            this.Schema_aggregateRating = new List <string>();
            if (propSchema_aggregateRating != null && propSchema_aggregateRating.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_aggregateRating.PropertyValues)
                {
                    this.Schema_aggregateRating.Add(propValue.Value);
                }
            }
            SemanticPropertyModel propSchema_productionCompany = pSemCmsModel.GetPropertyByPath("http://schema.org/productionCompany");

            this.Schema_productionCompany = new List <string>();
            if (propSchema_productionCompany != null && propSchema_productionCompany.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_productionCompany.PropertyValues)
                {
                    this.Schema_productionCompany.Add(propValue.Value);
                }
            }
            this.Schema_recordedAt = new List <int>();
            SemanticPropertyModel propSchema_recordedAt = pSemCmsModel.GetPropertyByPath("http://schema.org/recordedAt");

            if (propSchema_recordedAt != null && propSchema_recordedAt.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_recordedAt.PropertyValues)
                {
                    this.Schema_recordedAt.Add(GetNumberIntPropertyMultipleValueSemCms(propValue).Value);
                }
            }
            SemanticPropertyModel propSchema_countryOfOrigin = pSemCmsModel.GetPropertyByPath("http://schema.org/countryOfOrigin");

            this.Schema_countryOfOrigin = new List <string>();
            if (propSchema_countryOfOrigin != null && propSchema_countryOfOrigin.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_countryOfOrigin.PropertyValues)
                {
                    this.Schema_countryOfOrigin.Add(propValue.Value);
                }
            }
            this.Schema_duration = new List <int>();
            SemanticPropertyModel propSchema_duration = pSemCmsModel.GetPropertyByPath("http://schema.org/duration");

            if (propSchema_duration != null && propSchema_duration.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_duration.PropertyValues)
                {
                    this.Schema_duration.Add(GetNumberIntPropertyMultipleValueSemCms(propValue).Value);
                }
            }
            SemanticPropertyModel propSchema_inLanguage = pSemCmsModel.GetPropertyByPath("http://schema.org/inLanguage");

            this.Schema_inLanguage = new List <string>();
            if (propSchema_inLanguage != null && propSchema_inLanguage.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_inLanguage.PropertyValues)
                {
                    this.Schema_inLanguage.Add(propValue.Value);
                }
            }
            SemanticPropertyModel propSchema_award = pSemCmsModel.GetPropertyByPath("http://schema.org/award");

            this.Schema_award = new List <string>();
            if (propSchema_award != null && propSchema_award.PropertyValues.Count > 0)
            {
                foreach (SemanticPropertyModel.PropertyValue propValue in propSchema_award.PropertyValues)
                {
                    this.Schema_award.Add(propValue.Value);
                }
            }
            this.Schema_description   = GetPropertyValueSemCms(pSemCmsModel.GetPropertyByPath("http://schema.org/description"));
            this.Schema_image         = GetPropertyValueSemCms(pSemCmsModel.GetPropertyByPath("http://schema.org/image"));
            this.Schema_name          = GetPropertyValueSemCms(pSemCmsModel.GetPropertyByPath("http://schema.org/name"));
            this.Schema_datePublished = GetDateValuePropertySemCms(pSemCmsModel.GetPropertyByPath("http://schema.org/datePublished")).Value;
            this.Schema_contentRating = GetPropertyValueSemCms(pSemCmsModel.GetPropertyByPath("http://schema.org/contentRating"));
        }
Esempio n. 3
0
 public Person(SemanticEntityModel pSemCmsModel, LanguageEnum idiomaUsuario) : base()
 {
     this.mGNOSSID    = pSemCmsModel.Entity.Uri;
     this.mURL        = pSemCmsModel.Properties.FirstOrDefault(p => p.PropertyValues.Any(prop => prop.DownloadUrl != null))?.FirstPropertyValue.DownloadUrl;
     this.Schema_name = GetPropertyValueSemCms(pSemCmsModel.GetPropertyByPath("http://schema.org/name"));
 }