Template system for RDF?
RDF is a schema-free system to represent data. However, most of the time I find myself writing a sort of well-known graph structure, and I have to build triple by triple. In the more general case, this well known graph structure is of course not guaranteed to be complete nor fixed (e.g. something else can be added). However, if a more or less invariant backbone exists, i开发者_Python百科t would be nice to describe this backbone with placeholders and then pass a context to produce the fully deployed RDF graph.
Does something like this exist in Python?
Sounds a little like using a SPARQL CONSTRUCT
query to make the final graph. Run a regular query (WHERE {}
) against a graph to form some variable bindings and then use the CONSTRUCT {}
block to make the templated graph into your final answer. Any modern rdf library should have support for SPARQL.
精彩评论