According to the javadoc, Now
will “Bind the first arg to the current date time in the current locale and timezone.” I haven't tried using Now
, but I'd expect that "the current date time in the current locale and timezone" is a some sort of RDF literal (perhaps a date or datetime)? Literals cannot be the subjects of triples in RDF. For the rule
[rule1: (?x ?rdf:type ?y),(?y rdfs:subClassOf ?z),now(?x) -> (?x rdfs:type ?z)]
to match in the graph, the variable ?x
will be bound to the date literal, say, "2013-05-24"
(but as I mentioned, I don't know exactly what Now
will produce) but there cannot be any matches for (?x rdf:type ?y)
because these would have the form "2013-05-24" rdf:type ?y
and there cannot be triples of that form. This means that the rule cannot fire.
If you want to add a timestamp to something, you probably want an n-ary relation, so that you're actually representing (or representing, in addition to ?x rdf:type ?z
) a relation inferredSubclassRule(?super,?sub,?time ), which can be represented in RDF by a blank node like:
[] a :inferredSubclassRule ;
:hasSuperClass ?super ;
:hasSubClass ?sub ;
:hasTimestamp ?time .