Syndication

rdfvocab.cpp
1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#include "rdfvocab.h"
9#include "model.h"
10#include "property.h"
11
12#include <QCoreApplication>
13#include <QString>
14
15namespace Syndication
16{
17namespace RDF
18{
19class SYNDICATION_NO_EXPORT RDFVocab::RDFVocabPrivate
20{
21public:
22 QString namespaceURI;
23 ResourcePtr seq;
24 PropertyPtr type;
25 PropertyPtr li;
26
27 static RDFVocab *sSelf;
28 static void cleanupRDFVocab()
29 {
30 delete sSelf;
31 sSelf = nullptr;
32 }
33};
34RDFVocab *RDFVocab::RDFVocabPrivate::sSelf = nullptr;
35
37{
38 static RDFVocabPrivate p;
39 if (!p.sSelf) {
40 p.sSelf = new RDFVocab;
41 qAddPostRoutine(RDFVocabPrivate::cleanupRDFVocab);
42 }
43 return p.sSelf;
44}
45
46RDFVocab::RDFVocab()
47 : d(new RDFVocabPrivate)
48{
49 QString ns = QStringLiteral("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
50
51 d->namespaceURI = ns;
52
53 d->seq = ResourcePtr(new Resource(ns + QLatin1String("Seq")));
54 d->type = PropertyPtr(new Property(ns + QLatin1String("type")));
55 d->li = PropertyPtr(new Property(ns + QLatin1String("li")));
56}
57
58RDFVocab::~RDFVocab() = default;
59
61{
62 return d->seq;
63}
64
66{
67 return d->type;
68}
69
71{
72 return d->li;
73}
74
76{
77 return d->namespaceURI;
78}
79
80} // namespace RDF
81} // namespace Syndication
a property is node type that represents properties of things, like "name" is a property of a person,...
Definition property.h:32
singleton holding RDF vocabulary, expressed as RDF.
Definition rdfvocab.h:32
PropertyPtr li()
the rdf:li property, used for list items in RDF containers (like rdf:seq)
Definition rdfvocab.cpp:70
PropertyPtr type()
the rdf:type property (A rdf:type B means A is instance of B)
Definition rdfvocab.cpp:65
static RDFVocab * self()
returns the singleton instance
Definition rdfvocab.cpp:36
QString namespaceURI()
the RDF namespace, which is http://www.w3.org/1999/02/22-rdf-syntax-ns#
Definition rdfvocab.cpp:75
ResourcePtr seq()
the sequence type
Definition rdfvocab.cpp:60
Resources are the entities in the RDF graph.
Definition resource.h:37
Type type(const QSqlDatabase &db)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.