Ejemplo n.º 1
0
        public static int?GetIntProperty(this OntologyResource resource, string propertyName)
        {
            LiteralNode ln = resource.GetProperty(propertyName) as LiteralNode;

            if (ln == null)
            {
                return(null);
            }
            try
            {
                return((int?)(double.Parse(ln.Value)));
            }
            catch (FormatException)
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
 public static string GetStringProperty(this OntologyResource resource, string propertyName)
 {
     return((resource.GetProperty(propertyName) as LiteralNode)?.Value);
 }