Exemplo n.º 1
0
        private static void AddPropertyToStore(OwlInstanceSupertype supertype, PropertyInfo pi, IInMemoryQueryableStore ms)
        {
            if (supertype == null)
                throw new ArgumentNullException("supertype");
            if (pi == null)
                throw new ArgumentNullException("pi");
            if (ms == null)
                throw new ArgumentNullException("ms");

            if (pi.GetValue(supertype, null) != null)
            {
                Add(supertype.InstanceUri, pi.GetOwlResourceUri(), pi.GetValue(supertype, null).ToString(), ms);
                #region Tracing
#line hidden
                if (Logger.IsDebugEnabled)
                {
                    Logger.Debug("Added property {0} to store.", pi.Name);
                }
#line default
                #endregion
            }
        }
        private void GetTripleText(OwlInstanceSupertype oc, PropertyInfo info, IGraph g, StringBuilder sb)
        {
            if (info.GetValue(oc, null) != null)
            {
                if (info.GetOwlResource() == null) return;

                sb.Append(this.FormatAsUri(oc.InstanceUri));
                sb.Append(' ');
                sb.Append(this.FormatAsUri(info.GetOwlResourceUri()));
                sb.Append(' ');
                String dtUri = info.GetDatatypeUri();
                if (dtUri == null)
                {
                    sb.Append(this.Format(g.CreateLiteralNode(info.GetValue(oc, null).ToString())));
                }
                else
                {
                    sb.Append(this.Format(g.CreateLiteralNode(info.GetValue(oc, null).ToString(), new Uri(dtUri))));
                }
                sb.AppendLine(" .");
            }
        }