예제 #1
0
        protected static string GetValueOfAboutNode(INode node, Type type)
        {
            PropertyInfo _;
            var          about = RdfAboutAttribute.Get(type, out _);

            if (String.IsNullOrWhiteSpace(about?.IriFormatString))
            {
                return(null);
            }

            return(RdfAboutAttribute.Unformat(about.IriFormatString, node.ToString()));
        }
예제 #2
0
        protected static INode GetAboutNodeForValue <T>(T value, Type type)
        {
            PropertyInfo _;
            var          about = RdfAboutAttribute.Get(type, out _);

            if (String.IsNullOrWhiteSpace(about?.IriFormatString))
            {
                return(null);
            }

            return(new IriNode(String.Format(about.IriFormatString, value)));
        }
예제 #3
0
 /// <summary>
 /// Gets the <see cref="RdfAboutAttribute" /> of the object.
 /// </summary>
 public RdfAboutAttribute GetAboutAttribute(out PropertyInfo property)
 => RdfAboutAttribute.Get(this.GetType(), out property);