

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# SPARQL 主旨預測範例
<a name="machine-learning-sparql-inference-subject-prediction"></a>

*主旨預測*會預測指定述詞和物件的主旨。

例如，下列查詢預測誰 (類型 `foaf:User`) 將觀看給定的電影：

```
SELECT * WHERE { ?input {{(a foaf:Movie)}} .
    SERVICE neptune-ml:inference {
        neptune-ml:config neptune-ml:modelType 'SUBJECT_PREDICTION' ;
                          neptune-ml:input ?input ;
                          neptune-ml:predicate <http://aws.amazon.com/neptune/csv2rdf/object_Property/rated> ;
                          neptune-ml:output ?output ;
                          neptune-ml:outputClass <http://aws.amazon.com/neptune/csv2rdf/class/User> ;        }
}
```