Class OdfRdfMetadata
Provides the OdfRdfMetadata API.
表示 ODF 封裝中 META-INF/manifest.rdf 的 RDF metadata 集合。
public sealed class OdfRdfMetadata
- Inheritance
-
OdfRdfMetadata
- Inherited Members
Constructors
OdfRdfMetadata()
public OdfRdfMetadata()
Properties
Triples
Provides the Triples member. 取得目前記錄的 RDF triples。
public IReadOnlyList<OdfRdfTriple> Triples { get; }
Property Value
Methods
AddTriple(OdfRdfTriple)
Adds triple. 新增一筆 RDF triple。
public void AddTriple(OdfRdfTriple triple)
Parameters
tripleOdfRdfTriple要新增的 RDF triple
Exceptions
- ArgumentNullException
當
triple為 null 時拋出
AddTriple(string, string, string)
Short overload of AddTriple that accepts subject, predicate, and objectValue; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 subject、predicate 與 objectValue;其餘可選參數使用預設值並轉呼叫最長 AddTriple 多載。
public void AddTriple(string subject, string predicate, string objectValue)
Parameters
AddTriple(string, string, string, bool)
Adds triple. 新增一筆 RDF triple。
public void AddTriple(string subject, string predicate, string objectValue, bool isLiteral)
Parameters
subjectstring主詞 IRI
predicatestring述詞 IRI
objectValuestring受詞值
isLiteralbool受詞是否為 literal;若為 false,則視為資源 IRI
Exceptions
- ArgumentException
當任一必要值為空白時拋出
Clear()
Performs the Clear operation. 清除全部 RDF triples。
public void Clear()
GetLinkedPartPaths(string)
Gets linked part paths. 取得指定文件主詞已連結的封裝組件路徑。
public IReadOnlyList<string> GetLinkedPartPaths(string documentSubject)
Parameters
documentSubjectstring文件主詞 IRI
Returns
- IReadOnlyList<string>
已正規化之組件路徑集合
GetTriples()
Short overload of GetTriples that uses default values for all optional parameters and forwards to the full overload. 便利多載:GetTriples 的所有可選參數使用預設值並轉呼叫最長多載。
public IReadOnlyList<OdfRdfTriple> GetTriples()
Returns
GetTriples(string?)
Short overload of GetTriples that accepts subject; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 subject;其餘可選參數使用預設值並轉呼叫最長 GetTriples 多載。
public IReadOnlyList<OdfRdfTriple> GetTriples(string? subject)
Parameters
subjectstring
Returns
GetTriples(string?, string?)
Gets RDF triples filtered by subject and predicate. 依主詞與述詞篩選 RDF triples。
public IReadOnlyList<OdfRdfTriple> GetTriples(string? subject, string? predicate)
Parameters
subjectstringThe subject IRI, or null to include all subjects. / 主詞 IRI;為 null 時不篩選主詞。
predicatestringThe predicate IRI, or null to include all predicates. / 述詞 IRI;為 null 時不篩選述詞。
Returns
- IReadOnlyList<OdfRdfTriple>
The matching triples. / 符合條件的 triple 清單。
LinkDocumentPart(string, string)
Performs link document part.
建立文件主詞與封裝組件之間的 pkg:hasPart 關聯。
public void LinkDocumentPart(string documentSubject, string partPath)
Parameters
RemoveTriples(string)
Short overload of RemoveTriples that accepts subject; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 subject;其餘可選參數使用預設值並轉呼叫最長 RemoveTriples 多載。
public int RemoveTriples(string subject)
Parameters
subjectstring
Returns
RemoveTriples(string, string?)
Removes triples. 移除符合主詞與述詞的 RDF triples。
public int RemoveTriples(string subject, string? predicate)
Parameters
Returns
- int
移除的 triple 數量
SetPartMimeType(string, string)
Sets part mime type.
設定封裝組件的 pkg:mimeType literal。
public void SetPartMimeType(string partSubject, string mimeType)
Parameters
SyncWithPackageEntries(IEnumerable<string>, IReadOnlyDictionary<string, string>)
Short overload of SyncWithPackageEntries that accepts entryPaths; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 entryPaths;其餘可選參數使用預設值並轉呼叫最長 SyncWithPackageEntries 多載。
public int SyncWithPackageEntries(IEnumerable<string> entryPaths, IReadOnlyDictionary<string, string> mediaTypes)
Parameters
entryPathsIEnumerable<string>mediaTypesIReadOnlyDictionary<string, string>
Returns
SyncWithPackageEntries(IEnumerable<string>, IReadOnlyDictionary<string, string>, string?)
Performs sync with package entries.
依目前封裝項目同步 pkg:hasPart 與 pkg:mimeType 三元組。
public int SyncWithPackageEntries(IEnumerable<string> entryPaths, IReadOnlyDictionary<string, string> mediaTypes, string? documentSubject)
Parameters
entryPathsIEnumerable<string>封裝項目路徑集合
mediaTypesIReadOnlyDictionary<string, string>專案路徑對應的 MIME 類型對照表
documentSubjectstring文件主詞 IRI;為 null 時沿用既有
pkg:hasPart主詞或空字串
Returns
- int
新增或更新的 triple 數量
Exceptions
- ArgumentNullException
當
entryPaths或mediaTypes為 null 時拋出
TryGetLiteral(string, string, out string)
Tries to get literal. 嘗試取得指定主詞與述詞的 literal 受詞。
public bool TryGetLiteral(string subject, string predicate, out string value)