Representation of a ContentItem. More...
#include <ContentItem.hpp>
Public Member Functions | |
ContentItem (const std::string &baseUrl, const std::string &contentDirectory, const boost::uuids::uuid &id) | |
Create a new content item using the given server base URL and a unique UUID as content item identifier. More... | |
ContentItem (const std::string &baseUrl, const std::string &contentDirectory, const mico::rdf::model::URI &uri) | |
Create a new content item using the given server base URL and a URI as content item identifier. More... | |
std::string | getBaseUrl () const |
Return the (base URL) used by this content item. More... | |
const mico::rdf::model::URI | getURI () const |
Return the identifier (a unique URI) for this content item. More... | |
ContentItemMetadata & | getMetadata () |
Return (read-only) content item metadata part of the initial content item, e.g. More... | |
ExecutionMetadata & | getExecution () |
Return execution plan and metadata (e.g. More... | |
ResultMetadata & | getResult () |
Return the current state of the analysis result (as RDF metadata). More... | |
Content * | createContentPart () |
Create a new content part with a random URI and return a handle. More... | |
Content * | createContentPart (const mico::rdf::model::URI &id) |
Create a new content part with the given URI and return a handle. More... | |
Content * | getContentPart (const mico::rdf::model::URI &id) |
Return a handle to the ContentPart with the given URI, or null in case the content item does not have this content part. More... | |
void | deleteContentPart (const mico::rdf::model::URI &id) |
Remove the content part with the given URI in case it exists and is a part of this content item. More... | |
Content * | operator[] (const mico::rdf::model::URI &id) |
Convenient C++ style operator for accessing and constructing content parts. More... | |
content_part_iterator | begin () |
Return an iterator over all content parts contained in this content item. More... | |
content_part_iterator | end () |
Return the end iterator for content parts. More... | |
Protected Attributes | |
const std::string & | baseUrl |
const std::string & | contentDirectory |
boost::uuids::uuid | id |
ContentItemMetadata | metadata |
ExecutionMetadata | execution |
ResultMetadata | result |
Friends | |
bool | operator== (const ContentItem &ci1, const ContentItem &ci2) |
Representation of a ContentItem.
A ContentItem is a collection of ContentParts, e.g. an HTML page together with its embedded images. ContentParts can be either original content or created during analysis.
mico::persistence::ContentItem::ContentItem | ( | const std::string & | baseUrl, |
const std::string & | contentDirectory, | ||
const boost::uuids::uuid & | id | ||
) |
Create a new content item using the given server base URL and a unique UUID as content item identifier.
The URI of the content item will be composed of the base URL and the id.
baseUrl | base URL of the marmotta server |
id | a unique UUID identifying the content item |
mico::persistence::ContentItem::ContentItem | ( | const std::string & | baseUrl, |
const std::string & | contentDirectory, | ||
const mico::rdf::model::URI & | uri | ||
) |
Create a new content item using the given server base URL and a URI as content item identifier.
The base URL must be a prefix of the URI of the content item.
baseUrl | base URL of the marmotta server |
uri | a unique URI identifying the content item (must have baseUrl as prefix) |
content_part_iterator mico::persistence::ContentItem::begin | ( | ) |
Return an iterator over all content parts contained in this content item.
Content * mico::persistence::ContentItem::createContentPart | ( | ) |
Create a new content part with a random URI and return a handle.
The handle can then be used for updating the content and metadata of the content part.
Content * mico::persistence::ContentItem::createContentPart | ( | const mico::rdf::model::URI & | id | ) |
Create a new content part with the given URI and return a handle.
The handle can then be used for updating the content and metadata of the content part.
id | the URI of the content part to create |
void mico::persistence::ContentItem::deleteContentPart | ( | const mico::rdf::model::URI & | id | ) |
Remove the content part with the given URI in case it exists and is a part of this content item.
Otherwise do nothing.
id | the URI of the content part to delete |
content_part_iterator mico::persistence::ContentItem::end | ( | ) |
Return the end iterator for content parts.
Can be used to check when iteration is completed.
|
inline |
Return the (base URL) used by this content item.
Content * mico::persistence::ContentItem::getContentPart | ( | const mico::rdf::model::URI & | id | ) |
Return a handle to the ContentPart with the given URI, or null in case the content item does not have this content part.
id | the URI of the content part to return |
|
inline |
Return execution plan and metadata (e.g.
dependencies, profiling information, execution information). Can be updated by other components to add their execution information.
TODO: could return a specialised Metadata object once we know the schema for execution metadata
|
inline |
|
inline |
Return the current state of the analysis result (as RDF metadata).
Can be updated by other components to extend the result with new information. This will hold the final analysis results.
|
inline |
Return the identifier (a unique URI) for this content item.
Content * mico::persistence::ContentItem::operator[] | ( | const mico::rdf::model::URI & | id | ) |
Convenient C++ style operator for accessing and constructing content parts.
Returns the content part with the given ID if found or a newly created content part if not found.