I'd suggest reviewing the documentation on property paths as well.
https://www.w3.org/2009/sparql/wiki/Feature:PropertyPaths
http://docs.openlinksw.com/virtuoso/sparqlextensions.html#rdfsparqlaggregatepathexpressions
On 2016-06-11 07:08, S.M.Shamimul Hasan wrote:
> Greetings,
>
> I am running the following query on Virtuoso (7.1.0) SPARQL endpoint.
>
> ********************************************************************************
> select (?o1 as ?initialseed), ?begin, ?end, (count(?mid)+1 as ?length)
> where {
> GRAPH ?g
> {
> ?begin <http://test.edu/abc/vocab/getInfectedBy [3]> ?o1.
> ?end <http://test.edu/abc/vocab/getInfectedBy [3]>* ?mid.
> ?mid <http://test.edu/abc/vocab/getInfectedBy [3]>* ?begin.
> }
>
> {
> select ?o1, ?o2, ?e
> where{
> GRAPH ?g1
> {
> ?s <http://test.edu/abc/vocab/dendrogram_infector_pid [4]> ?o1.
> ?s <http://test.edu/abc/vocab/dendrogram_infectee_pid [5]> ?o2.
> ?s <http://test.edu/abc/vocab/dendrogram_iteration [6]> '0'^^xsd:decimal.
> ?s <http://test.edu/abc/vocab/dendrogram_exposureday [7]> ?e.
> ?s1 <http://test.edu/abc/vocab/contactnetwork_pid1 [8]> ?o1.
> ?s1 <http://test.edu/abc/vocab/contactnetwork_pid2 [9]> ?o2.
> ?s1 <http://test.edu/abc/vocab/contactnetwork_acttype1 [10]> '5'^^xsd:decimal.
> ?s1 <http://test.edu/abc/vocab/contactnetwork_acttype1 [10]> '5'^^xsd:decimal
> }
> }ORDER BY ASC(?e) LIMIT 1
> }
>
> }GROUP BY ?o1 ?begin ?end
>
> ***********************************************************************************
> It is giving me following error.
>
> ************************************
>
> Virtuoso 37000 Error SP031: SPARQL compiler: Variable '_::trans_subj_7_1' is
> used in subexpressions of the query but not assigned
>
> ***********************************
>
> In the query instead of "GRAPH ?g" if I use FROM clause with graph URI then
> query works fine. However I need generic "GRAPH ?g." Please let me know how I
> can fix it.
>
> Thank you.
>
> Regards,
> S.M.Shamimul Hasan
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e [1]
>
> _______________________________________________
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users [2]
Links:
------
[1] https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
[2] https://lists.sourceforge.net/lists/listinfo/virtuoso-users
[3] http://test.edu/abc/vocab/getInfectedBy
[4] http://test.edu/abc/vocab/dendrogram_infector_pid
[5] http://test.edu/abc/vocab/dendrogram_infectee_pid
[6] http://test.edu/abc/vocab/dendrogram_iteration
[7] http://test.edu/abc/vocab/dendrogram_exposureday
[8] http://test.edu/abc/vocab/contactnetwork_pid1
[9] http://test.edu/abc/vocab/contactnetwork_pid2
[10] http://test.edu/abc/vocab/contactnetwork_acttype1
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users