Go to the documentation of this file.
19 use Wikimedia\Purtle\RdfWriter;
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#' );
75 $this->rdfWriter->about( $this->
titleToUrl( $titleFrom ) )
76 ->say( self::ONTOLOGY_PREFIX,
'isInCategory' )
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 );
Helper class to produce RDF representation of categories.
const OWL_URL
OWL description of the ontology.
const ONTOLOGY_URL
Base URL for Mediawiki ontology.
labelToUrl( $titleLabel)
Make URL from title label.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
namespace and then decline to actually register it file or subcat img or subcat $title
const FORMAT_VERSION
Current version of the dump format.
writeCategoryLinkData( $fromName, $toName)
Write RDF data for link between categories.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
titleToUrl(Title $title)
Convert Title to link to target page.
const SPECIAL_DUMP
Special page for Dump identification.
writeCategoryData( $categoryName, $isHidden, $pages, $subcategories)
Write out the data for single category.
setupPrefixes()
Setup prefixes relevant for the dump.
Represents a title within MediaWiki.
__construct(RdfWriter $writer)
const ONTOLOGY_PREFIX
Prefix used for Mediawiki ontology in the dump.
getDumpURI()
Get URI of the dump for this particular wiki.