# This ontology.
@prefix trist:    <http://ontologi.es/trist#> .
@prefix stats:    <http://ontologi.es/trist#statistics/> .

# Related.
@prefix void:     <http://rdfs.org/ns/void#> .

# Stock imports.
@prefix cc:       <http://creativecommons.org/ns#> .
@prefix dc:       <http://purl.org/dc/terms/> .
@prefix dcmitype: <http://purl.org/dc/dcmitype/> .
@prefix foaf:     <http://xmlns.com/foaf/0.1/> .
@prefix link:     <http://www.w3.org/2006/link#> .
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos:     <http://www.w3.org/2004/02/skos/core#> .
@prefix status:   <http://ontologi.es/status#> .
@prefix vann:     <http://purl.org/vocab/vann/> .
@prefix vs:       <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
@prefix xhv:      <http://www.w3.org/1999/xhtml/vocab#> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .

## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## 

trist:
	rdfs:label "The trist Vocabulary"@en ;
	rdfs:seeAlso void: ;
	foaf:maker <http://tobyinkster.co.uk/#i> ;
	rdfs:comment """A lightweight vocabulary for describing datasets.
	
	Example:
	
	_:dataset1
	
		stats:subject [
		
			# the dataset describes 14 different subjects
			trist:unique-values 14 ;
			
			# the thing that is the subject of the most triples is...
			trist:top-value [
					trist:value <http://example.com/> ;
					trist:count 12   # that's how many triples it's subject of
				]
			] ;
			
		# most literals in the dataset are in English
		stats:language [ trist:top-value [ trist:value "en"^^xsd:language ] ] ;
		
		# the dataset includes 18 uses of the Dublin Core vocab
		trist:uses-vocab [
			trist:value <http://purl.org/dc/terms/>
			trist:count 18 
			] ;
		
		# the dataset describes example.com. We already know that
		# it's the top subject, but it may be the object of some
		# triples too.
		trist:describes [
				trist:value <http://example.com/> ;
				trist:count 17  # that's how many triples it's in total
			] .
	"""@en
	.

trist:statement-count
	a owl:DatatypeProperty ;
	rdfs:label "statement count"@en ;
	rdfs:comment "The number of RDF triples in a dataset.\n"@en ;
	rdfs:domain void:Dataset ;
	rdfs:range xsd:int .

trist:uses-vocab
	a owl:ObjectProperty ;
	rdfs:label "uses vocab"@en ;
	rdfs:comment "Links to usage details describing how a dataset uses a vocabulary."@en ;
	rdfs:domain void:Dataset ;
	rdfs:range trist:UsageDetails .

trist:describes
	a owl:ObjectProperty ;
	rdfs:label "describes"@en ;
	rdfs:comment "Links to usage details describing how a dataset describes an instance."@en ;
	rdfs:domain void:Dataset ;
	rdfs:range trist:UsageDetails .

trist:value
	a rdf:Property ;
	rdfs:label "value"@en ;
	rdfs:subPropertyOf rdf:value ;
	rdfs:domain trist:UsageDetails .

trist:count
	a rdf:Property ;
	rdfs:label "count"@en ;
	rdfs:domain trist:UsageDetails ;
	rdfs:range xsd:int .

trist:stats
	a owl:ObjectProperty ;
	rdfs:label "stats"@en ;
	rdfs:domain void:Dataset ;
	rdfs:range trist:StatisticalSummary .

trist:top-value
	a owl:ObjectProperty ;
	rdfs:label "top value"@en ;
	rdfs:domain trist:StatisticalSummary ;
	rdfs:range trist:UsageDetails .

trist:unique-values
	a owl:DatatypeProperty ;
	rdfs:label "unique values"@en ;
	rdfs:domain trist:StatisticalSummary ;
	rdfs:range xsd:int .

stats:node
	a owl:ObjectProperty ;
	rdfs:subPropertyOf trist:stats ;
	rdfs:label "node"@en ;
	rdfs:comment "Statistics about all nodes (resources and literals; subjects, predicates and objects) in the dataset."@en .
	
stats:subject
	a owl:ObjectProperty ;
	rdfs:subPropertyOf trist:stats ;
	rdfs:label "subject"@en ;
	rdfs:comment "Statistics about all subjects in the dataset."@en .
	
stats:predicate
	a owl:ObjectProperty ;
	rdfs:subPropertyOf trist:stats ;
	rdfs:label "predicate"@en ;
	rdfs:comment "Statistics about all predicates in the dataset."@en .

stats:object
	a owl:ObjectProperty ;
	rdfs:subPropertyOf trist:stats ;
	rdfs:label "object"@en ;
	rdfs:comment "Statistics about all objects in the dataset."@en .
	
stats:type
	a owl:ObjectProperty ;
	rdfs:subPropertyOf trist:stats ;
	rdfs:label "type"@en ;
	rdfs:comment "Statistics about all objects of rdf:type triples in the dataset."@en .

stats:language
	a owl:ObjectProperty ;
	rdfs:subPropertyOf trist:stats ;
	rdfs:label "language"@en ;
	rdfs:comment "Statistics about the language tags of object literals in the dataset."@en .

stats:datatype
	a owl:ObjectProperty ;
	rdfs:subPropertyOf trist:stats ;
	rdfs:label "datatype"@en ;
	rdfs:comment "Statistics about the datatypes of typed object literals in the dataset."@en .

stats:vocabulary
	a owl:ObjectProperty ;
	rdfs:subPropertyOf trist:stats ;
	rdfs:label "vocabulary"@en ;
	rdfs:comment "Statistics about the vocabularies of predicates and rdf:type objects in the dataset."@en .


