Beispiel #1
0
        public object Visit(ExeStatement e)
        {
            if (e.modality != Statement.Modality.IS)
            {
                return(CreateNull());
            }

            return(CreateNull());
        }
Beispiel #2
0
        public object Visit(ExeStatement e)
        {
            swrlAttrsBody = new HashSet <string>();
            swrlAttrsHead = new HashSet <string>();
            StringBuilder sb = new StringBuilder();

            sb.Append("⌂");
            using (swrlCurAttr.set(swrlAttrsBody))
                sb.Append(e.slp.accept(this));
            sb.Append("~→");
            sb.Append(e.exe);
            sb.Append("(");
            using (swrlCurAttr.set(swrlAttrsHead))
                sb.Append(e.args.accept(this));
            sb.Append(")");
            return(sb.ToString());
        }
Beispiel #3
0
        public override object Visit(ExeStatement rule)
        {
            if (runExeRules)
            {
                var idx = Interlocked.Increment(ref swrl_cnt);
                id2stmt.Add("swrl-" + idx.ToString(), rule);
                sb.Append("[swrl-" + idx.ToString() + ": ");
                rule.slp.accept(this);
                sb.Append(" -> ");
                if (model != null)
                {
                    DL.Serializer ser   = new Serializer();
                    var           nrule = new CNL.DL.ExeStatement(null)
                    {
                        args = rule.args, exe = "<?...?>", slp = rule.slp
                    };
                    var dl  = ser.Serialize(nrule);
                    var iid = model.createTypedLiteral("\'" + dl.Replace("\'", "\\\'").ToString() + "\'", org.apache.jena.datatypes.xsd.XSDDatatype.XSDstring).toString();
                    if (debugExeRules)
                    {
                        sb.Append(" debugTraceBuiltIn (" + iid + "),");
                    }
                }

                var lst = rule.exe;

                for (int i = 0; i < rule.args.list.Count; i++)
                {
                    var dn = rule.args.list[i].accept(this).ToString();
                    lst += ", ";
                    lst += dn;
                }

                sb.Append("executeExternalRule(" + lst + ")");
                sb.AppendLine("]");
            }
            return(null);
        }
Beispiel #4
0
 public virtual object Visit(ExeStatement e)
 {
     e.slp.accept(this);
     e.args.accept(this);
     return(e);
 }
Beispiel #5
0
 public override object Visit(ExeStatement e)
 {
     e.slp.accept(this);
     return(e);
 }
Beispiel #6
0
 public override object Visit(ExeStatement e)
 {
     builtinFound = true;
     return(null);
 }