36 const OWL_URL =
'https://www.mediawiki.org/ontology/ontology.owl';
53 $this->rdfWriter = $writer;
60 $this->rdfWriter->prefix( self::ONTOLOGY_PREFIX, self::ONTOLOGY_URL );
61 $this->rdfWriter->prefix(
'rdfs',
'http://www.w3.org/2000/01/rdf-schema#' );
62 $this->rdfWriter->prefix(
'owl',
'http://www.w3.org/2002/07/owl#' );
63 $this->rdfWriter->prefix(
'schema',
'http://schema.org/' );
64 $this->rdfWriter->prefix(
'cc',
'http://creativecommons.org/ns#' );
73 $titleFrom = Title::makeTitle(
NS_CATEGORY, $fromName );
74 $titleTo = Title::makeTitle(
NS_CATEGORY, $toName );
75 $this->rdfWriter->about( $this->
titleToUrl( $titleFrom ) )
76 ->say( self::ONTOLOGY_PREFIX,
'isInCategory' )
92 $title = Title::makeTitle(
NS_CATEGORY, $categoryName );
93 $this->rdfWriter->about( $this->
titleToUrl( $title ) )
95 ->is( self::ONTOLOGY_PREFIX,
'Category' );
97 $this->rdfWriter->is( self::ONTOLOGY_PREFIX,
'HiddenCategory' );
99 $titletext = $title->getText();
100 $this->rdfWriter->say(
'rdfs',
'label' )->value( $titletext );
101 $this->rdfWriter->say( self::ONTOLOGY_PREFIX,
'pages' )->value( $pages );
102 $this->rdfWriter->say( self::ONTOLOGY_PREFIX,
'subcategories' )->value( $subcategories );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Helper class to produce RDF representation of categories.
setupPrefixes()
Setup prefixes relevant for the dump.
const SPECIAL_DUMP
Special page for Dump identification.
const ONTOLOGY_URL
Base URL for Mediawiki ontology.
labelToUrl( $titleLabel)
Make URL from title label.
writeCategoryLinkData( $fromName, $toName)
Write RDF data for link between categories.
getDumpURI()
Get URI of the dump for this particular wiki.
__construct(RdfWriter $writer)
const ONTOLOGY_PREFIX
Prefix used for Mediawiki ontology in the dump.
const FORMAT_VERSION
Current version of the dump format.
titleToUrl(Title $title)
Convert Title to link to target page.
const OWL_URL
OWL description of the ontology.
writeCategoryData( $categoryName, $isHidden, $pages, $subcategories)
Write out the data for single category.
Represents a title within MediaWiki.