MarkLogic 12 EA 1 Product Documentation
cts.tripleValueStatistics

cts.tripleValueStatistics(
   [values as (String | Number | Boolean | null | Array | Object)[]],
   [forest-ids as (Number|String)[]]
) as Sequence

Summary

Returns statistics from the triple index for the values given. Note that these are estimates, rather than exact counts.

Parameters
values The values to look up.
forest-ids A sequence of IDs of forests to which the search will be constrained. An empty sequence means to search all forests in the database. The default is ().

Example

cts.tripleValueStatistics([
  sem.iri("http://www.w3.org/2000/01/rdf-schema#subClassOf"),
  sem.iri("http://swat.cse.lehigh.edu/onto/univ-bench.owl#worksFor")
])
=>
{
    "count": 1104552010,
    "uniqueSubjects": 190980967,
    "uniquePredicates": 587,
    "uniqueObjects": 280592619,
    "tripleValueEntries": [
        {
            "tripleValue": "http://www.w3.org/2000/01/rdf-schema#subClassOf",
            "count": 86,
            "subjectStatistics": {
                "count": 0,
                "uniquePredicates": 0,
                "uniqueObjects": 0
            },
            "predicateStatistics": {
                "count": 86,
                "uniqueSubjects": 81,
                "uniqueObjects": 51
            },
            "objectStatistics": {
                "count": 0,
                "uniqueSubjects": 0,
                "uniquePredicates": 0
            }
        },
        {
            "tripleValue": "http://swat.cse.lehigh.edu/onto/univ-bench.owl#worksFor",
            "count": 5754107,
            "subjectStatistics": {
                "count": 3,
                "uniquePredicates": 3,
                "uniqueObjects": 3
            },
            "predicateStatistics": {
                "count": 5754099,
                "uniqueSubjects": 5754099,
                "uniqueObjects": 856163
            },
            "objectStatistics": {
                "count": 4,
                "uniqueSubjects": 4,
                "uniquePredicates": 4
            }
        }
    ]
}
Powered by MarkLogic Server | Terms of Use | Privacy Policy