---
title: "SKDocumentGetParent(_:)"
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.3+]
path: coreservices/1444449-skdocumentgetparent
---

# SKDocumentGetParent(_:)

Gets the parent of a document URL object (of type SKDocument).

## Declaration

```swift
func SKDocumentGetParent(_ inDocument: SKDocument!) -> Unmanaged<SKDocument>!
```

## Parameters

- `inDocument`: The document URL object whose parent you want to get.

## Return Value

Return Value The parent document URL object, or NULL on failure.

## Discussion

Discussion Search Kit manages document locations in terms of URLs as Document URL objects (of type SKDocument). The parent document URL object typically contains the document’s URL up to but not including the document name. Typically, document URL objects contain the complete URL to a file-based document. But you can use this function iteratively to build up the complete file-system path for a document that you are managing as part of a document hierarchy. See the description for the SKDocument function for more on this.

## See Also

### Working with Documents and Terms

- [SKDocumentCreateWithURL(_:)](coreservices/1442564-skdocumentcreatewithurl.md)
- [SKDocumentCreate(_:_:_:)](coreservices/1443212-skdocumentcreate.md)
- [SKDocumentCopyURL(_:)](coreservices/1449624-skdocumentcopyurl.md)
- [SKDocumentGetName(_:)](coreservices/1442657-skdocumentgetname.md)
- [SKDocumentGetSchemeName(_:)](coreservices/1448262-skdocumentgetschemename.md)
- [SKDocumentGetTypeID()](coreservices/1448891-skdocumentgettypeid.md)
- [SKIndexCopyDocumentForDocumentID(_:_:)](coreservices/1442760-skindexcopydocumentfordocumentid.md)
- [SKIndexCopyInfoForDocumentIDs(_:_:_:_:_:)](coreservices/1445499-skindexcopyinfofordocumentids.md)
- [SKIndexCopyDocumentRefsForDocumentIDs(_:_:_:_:)](coreservices/1445305-skindexcopydocumentrefsfordocume.md)
- [SKIndexCopyDocumentURLsForDocumentIDs(_:_:_:_:)](coreservices/1443501-skindexcopydocumenturlsfordocume.md)
- [SKIndexCopyDocumentIDArrayForTermID(_:_:)](coreservices/1448003-skindexcopydocumentidarrayforter.md)
- [SKIndexCopyTermIDArrayForDocumentID(_:_:)](coreservices/1446868-skindexcopytermidarrayfordocumen.md)
- [SKIndexCopyTermStringForTermID(_:_:)](coreservices/1442802-skindexcopytermstringfortermid.md)
- [SKIndexGetTermIDForTermString(_:_:)](coreservices/1448558-skindexgettermidfortermstring.md)
- [SKIndexSetDocumentProperties(_:_:_:)](coreservices/1444576-skindexsetdocumentproperties.md)
- [SKIndexCopyDocumentProperties(_:_:)](coreservices/1449500-skindexcopydocumentproperties.md)
- [SKIndexGetDocumentState(_:_:)](coreservices/1443396-skindexgetdocumentstate.md)
- [SKIndexGetDocumentTermCount(_:_:)](coreservices/1448341-skindexgetdocumenttermcount.md)
- [SKIndexGetDocumentTermFrequency(_:_:_:)](coreservices/1447537-skindexgetdocumenttermfrequency.md)
- [SKIndexGetTermDocumentCount(_:_:)](coreservices/1444015-skindexgettermdocumentcount.md)
- [SKIndexGetDocumentID(_:_:)](coreservices/1444437-skindexgetdocumentid.md)
