Hi there, I am using Jena within a Spring MVC web application as interface for a rdf knowledge base. The main application for this knowledge base is to be queried with SPARQL for the best fitting (logistic) service provider for a certain conext.
I extended the ARQ with a property function, which task is to calculate a "fitness" value for each service provider. The problem is, that the calculation is depending on information that is only available within the requesting query method (i.e. a given transportation path, that is needed to calculate the distance from a service provider (stored in the knowledge base) to the path (a request-thing)). So, I am looking for a best practice to pass: a) The object (reference) itself or b) A Key for a ConcurrentMap to the property function calculating the fitness. I tried to extend the SPARQL query by binding a string literal to a new variable, so that it would be available in the binding or the context, but without success. My current solution is not threadsafe: The FitnessCalculator is registered via a factory as shown here (http://jena.sourceforge.net/ARQ/extension.html). The factory is a spring service and injects the query service reference to the property function. The query method then saves the transport path object in a public variable, that is accessable by the Property Function. Obviously, this will have side effects in a multi-threaded environment. I would appreciate any best practice tips! -- Martin
